<?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.0.2</version>
    </parent>

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

    <name>Camel Quarkus :: Build Parent</name>

    <properties>
        <supported-maven-versions>[3.5.3,)</supported-maven-versions>

        <groovy.version>2.5.7</groovy.version>
        <jetty.version>9.4.18.v20190429</jetty.version>
        <xstream.version>1.4.11</xstream.version>

        <maven-checkstyle-plugin.version>3.0.0</maven-checkstyle-plugin.version>
        <maven-checkstyle.version>7.6.1</maven-checkstyle.version>
        <jandex-maven-plugin.version>1.0.6</jandex-maven-plugin.version>
        <maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
        <gmavenplus-plugin.version>1.7.1</gmavenplus-plugin.version>
        <docker-maven-plugin.version>0.3.0</docker-maven-plugin.version>
    </properties>

    <dependencyManagement>
        <dependencies>

            <dependency>
                <groupId>org.apache.camel.quarkus</groupId>
                <artifactId>camel-quarkus-bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- External BOMs -->
            <dependency>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-build-parent</artifactId>
                <version>${quarkus.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>org.apache.camel.quarkus</groupId>
                <artifactId>camel-quarkus-core-deployment</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.camel.quarkus</groupId>
                <artifactId>camel-quarkus-jetty-common-deployment</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.camel.quarkus</groupId>
                <artifactId>camel-quarkus-xstream-common-deployment</artifactId>
                <version>${project.version}</version>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <failIfNoTests>false</failIfNoTests>
                        <systemProperties>
                            <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                        </systemProperties>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>io.quarkus</groupId>
                    <artifactId>quarkus-maven-plugin</artifactId>
                    <version>${quarkus.version}</version>
                </plugin>
                <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-enforcer-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>enforce</id>
                            <configuration>
                                <rules>
                                    <dependencyConvergence />
                                    <requireMavenVersion>
                                        <version>${supported-maven-versions}</version>
                                    </requireMavenVersion>
                                    <bannedDependencies>
                                        <excludes>
                                            <!-- Use javax.annotation-api -->
                                            <exclude>org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec</exclude>
                                            <exclude>org.jboss.spec.javax.annotation:jboss-annotations-api_1.3_spec</exclude>
                                            <!-- use our jboss-logmanager -->
                                            <exclude>org.jboss.logging:jboss-logmanager</exclude>
                                            <!-- We don't want all the API's in one jar-->
                                            <exclude>javax:javaee-api</exclude>
                                            <!-- Prevent incompatible config from coming in -->
                                            <exclude>org.wildfly.client:wildfly-client-config</exclude>
                                            <!-- Use Jakarta Activation -->
                                            <exclude>javax.activation:javax-activation-api</exclude>
                                            <exclude>javax.activation:activation</exclude>
                                            <exclude>org.jboss.marshalling:jboss-marshalling-osgi</exclude>
                                            <exclude>org.jboss.spec.javax.servlet:jboss-servlet-api_3.1_spec</exclude>
                                            <!-- The API is packaged by the implementation-->
                                            <exclude>javax.json:javax.json-api</exclude>
                                            <!-- Do not use Jakarta APIs for JSON -->
                                            <exclude>org.glassfish:jakarta.json</exclude>
                                            <exclude>jakarta.json.bind:jakarta.json.bind-api</exclude>
                                            <exclude>jakarta.json:jakarta.json-api</exclude>
                                        </excludes>
                                    </bannedDependencies>
                                </rules>
                            </configuration>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                        </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.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${maven-resources-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.gmavenplus</groupId>
                    <artifactId>gmavenplus-plugin</artifactId>
                    <version>${gmavenplus-plugin.version}</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.codehaus.groovy</groupId>
                            <artifactId>groovy</artifactId>
                            <version>${groovy.version}</version>
                            <scope>runtime</scope>
                        </dependency>
                        <dependency>
                            <groupId>org.codehaus.groovy</groupId>
                            <artifactId>groovy-ant</artifactId>
                            <version>${groovy.version}</version>
                            <scope>runtime</scope>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>jdk-8-classpath</id>
            <activation>
                <jdk>[9,</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration>
                            <release>8</release>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>sourcecheck</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <version>${maven-checkstyle-plugin.version}</version>
                        <dependencies>
                            <dependency>
                                <groupId>org.apache.camel</groupId>
                                <artifactId>camel-buildtools</artifactId>
                                <!-- TODO not in M2 -->
                                <version>3.0.0-M3</version>
                            </dependency>
                            <dependency>
                                <groupId>com.puppycrawl.tools</groupId>
                                <artifactId>checkstyle</artifactId>
                                <version>${maven-checkstyle.version}</version>
                            </dependency>
                        </dependencies>
                        <executions>
                            <execution>
                                <id>default-cli</id>
                                <phase>validate</phase>
                                <configuration>
                                    <includeResources>false</includeResources>
                                    <configLocation>camel-checkstyle.xml</configLocation>
                                    <consoleOutput>true</consoleOutput>
                                    <failsOnError>${checkstyle.failOnViolation}</failsOnError>
                                    <linkXRef>false</linkXRef>
                                    <suppressionsLocation>camel-checkstyle-suppressions.xml</suppressionsLocation>
                                    <encoding>UTF-8</encoding>
                                    <sourceDirectories>
                                        <sourceDirectory>${basedir}/src</sourceDirectory>
                                    </sourceDirectories>
                                    <headerLocation>header-java.txt</headerLocation>
                                    <includes>**/*.java,**/*.groovy,**/*.scala,**/*.properties,**/*.xml,**/*.xsd</includes>
                                    <excludes>**/MyRoutes*.java</excludes>
                                </configuration>
                                <goals>
                                    <goal>checkstyle</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
