<?xml version="1.0" encoding="UTF-8"?>
<!--

    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.apache.camel.quarkus</groupId>
        <artifactId>camel-quarkus-parent</artifactId>
        <version>0.4.0</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <artifactId>camel-quarkus-build-parent</artifactId>
    <packaging>pom</packaging>

    <name>Camel Quarkus :: Build Parent</name>
    <description>Maven plugins configuration</description>

    <properties>
        <mock-javamail.version>1.9</mock-javamail.version>

        <!-- maven-surefire-plugin -->
        <failIfNoTests>false</failIfNoTests>

        <jandex-maven-plugin.version>1.0.6</jandex-maven-plugin.version>
        <maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
        <docker-maven-plugin.version>0.3.0</docker-maven-plugin.version>
        <directory-maven-plugin.version>0.3.1</directory-maven-plugin.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- Import BOM -->
            <dependency>
                <groupId>org.apache.camel.quarkus</groupId>
                <artifactId>camel-quarkus-bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.jvnet.mock-javamail</groupId>
                <artifactId>mock-javamail</artifactId>
                <version>${mock-javamail.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>javax.mail</groupId>
                        <artifactId>mail</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>io.quarkus</groupId>
                    <artifactId>quarkus-bootstrap-maven-plugin</artifactId>
                    <version>${quarkus.version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>extension-descriptor</goal>
                            </goals>
                            <phase>compile</phase>
                            <configuration>
                                <deployment>${project.groupId}:${project.artifactId}-deployment:${project.version}
                                </deployment>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <configuration>
                        <quiet>true</quiet>
                        <doclint>none</doclint>
                        <show>package</show>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.gmaven</groupId>
                    <artifactId>groovy-maven-plugin</artifactId>
                    <version>${groovy-maven-plugin.version}</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.codehaus.groovy</groupId>
                            <artifactId>groovy-all</artifactId>
                            <version>${groovy.version}</version>
                            <type>pom</type>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.commonjava.maven.plugins</groupId>
                <artifactId>directory-maven-plugin</artifactId>
                <version>${directory-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>directories</id>
                        <goals>
                            <goal>highest-basedir</goal>
                        </goals>
                        <phase>validate</phase>
                        <configuration>
                            <property>camel.quarkus.project.root</property>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.gmaven</groupId>
                <artifactId>groovy-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>sanity-checks</id>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                        <phase>validate</phase>
                        <configuration>
                            <source>file://${camel.quarkus.project.root}/build/scripts/validate-dependencies.groovy</source>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-remote-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>process-resource-bundles</id>
                        <phase>none</phase><!-- skip to save time -->
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-generated-resources</id>
                        <goals>
                            <goal>resources</goal>
                        </goals>
                        <phase>process-classes</phase>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>${camel.quarkus.project.root}/build/legal</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>net.revelc.code.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
                <version>2.10.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>format</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <configFile>${camel.quarkus.project.root}/build/eclipse-formatter-config.xml</configFile>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
