<?xml version="1.0" encoding="UTF-8"?>
<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">
    <parent>
        <artifactId>quarkus-parent</artifactId>
        <groupId>io.quarkus</groupId>
        <version>0.25.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>quarkus-build-parent</artifactId>
    <name>Quarkus - Build Parent</name>
    <description>Build parent to bring in required dependencies</description>
    <packaging>pom</packaging>

    <properties>
        <!-- Maven plugin versions -->
        <elasticsearch-maven-plugin.version>6.14</elasticsearch-maven-plugin.version>
        <elasticsearch-server.version>7.3.1</elasticsearch-server.version>
        <scala-maven-plugin.version>4.1.1</scala-maven-plugin.version>

        <!-- These properties are needed in order for them to be resolvable by the generated projects -->
        <!-- Quarkus uses jboss-parent and it comes with 3.8.0-jboss-2, we don't want that in the templates -->
        <compiler-plugin.version>3.8.1</compiler-plugin.version>
        <kotlin.version>1.3.21</kotlin.version>
        <scala.version>2.12.8</scala.version>
        <scala-plugin.version>4.1.1</scala-plugin.version>

        <!-- These properties are needed in order for them to be resolvable by the documentation -->
        <!-- The Graal version we suggest using in documentation - as that's
           what we work with by self downloading it: -->
        <graal-sdk.version-for-documentation>19.2.0.1</graal-sdk.version-for-documentation>
        <rest-assured.version>3.3.0</rest-assured.version>
        <axle-client.version>0.0.9</axle-client.version>
        <vertx.version>3.8.1</vertx.version>
        <artemis.version>2.10.0</artemis.version>

        <!-- Dev tools -->
        <freemarker.version>2.3.28</freemarker.version>

        <!-- Arquillian BOM -->
        <arquillian.version>1.4.1.Final</arquillian.version>

        <!-- Enable APT by default for Eclipse -->
        <m2e.apt.activation>jdt_apt</m2e.apt.activation>

        <!--
        Supported Maven versions, interpreted as a version range
         -->
        <supported-maven-versions>[3.5.3,)</supported-maven-versions>

        <!-- These 2 properties are used by CreateProjectMojo to add the Maven Wrapper -->
        <proposed-maven-version>3.6.2</proposed-maven-version>
        <maven-wrapper.version>0.7.6</maven-wrapper.version>
        <gradle-wrapper.version>5.5.1</gradle-wrapper.version>

        <!-- MicroProfile TCK versions -->
        <microprofile-health-api.version>2.0.1</microprofile-health-api.version>
        <microprofile-config-api.version>1.3</microprofile-config-api.version>
        <microprofile-metrics-api.version>2.0.2</microprofile-metrics-api.version>
        <microprofile-reactive-messaging-api.version>1.0</microprofile-reactive-messaging-api.version>
        <microprofile-rest-client-api.version>1.2.1</microprofile-rest-client-api.version>
        <microprofile-open-api.version>1.1.2</microprofile-open-api.version>
        <microprofile-opentracing-api.version>1.3.1</microprofile-opentracing-api.version>
        <microprofile-context-propagation.version>1.0.1</microprofile-context-propagation.version>
        <microprofile-jwt-api.version>1.1.1</microprofile-jwt-api.version>

        <!-- Antlr is used by the PanacheQL parser-->
        <antlr.version>4.7.2</antlr.version>
    </properties>

    <dependencyManagement>
        <dependencies>

            <!-- Quarkus Extensions Dependencies are coming from quarkus-bom-deployment (that also imports quarkus-bom) -->
            <dependency>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-bom-deployment</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- Dev tools -->

            <dependency>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-devtools-common</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-devtools-common-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-creator</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.freemarker</groupId>
                <artifactId>freemarker</artifactId>
                <version>${freemarker.version}</version>
            </dependency>

            <!-- Miscellaneous -->
            <dependency>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-war-launcher-runner</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-legacy-launcher</artifactId>
                <version>${project.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <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>${project.version}</version>
                </plugin>
                <plugin>
                    <groupId>io.quarkus</groupId>
                    <artifactId>quarkus-bootstrap-maven-plugin</artifactId>
                    <version>${project.version}</version>
                    <executions>
                        <execution>
                            <id>generate-extension-descriptor</id>
                            <goals>
                                <goal>extension-descriptor</goal>
                            </goals>
                            <phase>process-resources</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>
                                            <!-- Ensure none of the deps use netty-all. This forces deps to use more fine grained netty artifacts -->
                                            <exclude>io.netty:netty-all</exclude>
                                            <!-- Ban Log4J (use org.jboss.logmanager:log4j-jboss-logmanager instead) -->
                                            <exclude>log4j:log4j</exclude>
                                            <exclude>org.apache.logging.log4j:log4j-api</exclude>
                                            <exclude>org.apache.logging.log4j:log4j-core</exclude>
                                            <exclude>org.apache.logging.log4j:log4j-slf4j-impl</exclude>
                                            <!-- Ban commons-logging (use org.jboss.logging:commons-logging-jboss-logging instead) -->
                                            <exclude>commons-logging:commons-logging</exclude>
                                            <exclude>commons-logging:commons-logging-api</exclude>
                                            <exclude>org.springframework:spring-jcl</exclude>
                                            <exclude>org.slf4j:jcl-over-slf4j</exclude>
                                            <!-- Ban SLF4j implementations (use org.jboss.slf4j:slf4j-jboss-logging instead) -->
                                            <exclude>org.slf4j:slf4j-simple</exclude>
                                            <exclude>org.slf4j:slf4j-nop</exclude>
                                            <exclude>org.slf4j:slf4j-jdk14</exclude>
                                            <exclude>org.slf4j:slf4j-log4j12</exclude>
                                            <exclude>org.slf4j:slf4j-log4j13</exclude>
                                        </excludes>
                                    </bannedDependencies>
                                </rules>
                            </configuration>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>io.fabric8</groupId>
                    <artifactId>docker-maven-plugin</artifactId>
                    <version>0.29.0</version>
                </plugin>
                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <configuration>
                        <quiet>true</quiet>
                        <doclint>none</doclint>
                        <show>package</show>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.jboss.jandex</groupId>
                    <artifactId>jandex-maven-plugin</artifactId>
                    <version>1.0.6</version>
                </plugin>
                <plugin>
                    <groupId>net.revelc.code.formatter</groupId>
                    <artifactId>formatter-maven-plugin</artifactId>
                    <version>2.8.1</version>
                    <configuration>
                        <configFile>${maven.multiModuleProjectDirectory}/ide-config/eclipse-format.xml</configFile>
                        <skip>${format.skip}</skip>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>net.revelc.code</groupId>
                    <artifactId>impsort-maven-plugin</artifactId>
                    <version>1.2.0</version>
                    <configuration>
                        <groups>java.,javax.,org.,com.</groups>
                        <staticGroups>*</staticGroups>
                        <skip>${format.skip}</skip>
                        <removeUnused>true</removeUnused>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.google.code.maven-replacer-plugin</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>1.5.3</version>
                </plugin>
                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <plugin>
                    <groupId>com.github.alexcojocaru</groupId>
                    <artifactId>elasticsearch-maven-plugin</artifactId>
                    <version>${elasticsearch-maven-plugin.version}</version>
                    <configuration>
                        <version>${elasticsearch-server.version}</version>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.antlr</groupId>
                    <artifactId>antlr4-maven-plugin</artifactId>
                    <version>${antlr.version}</version><!-- keep it aligned with the runtime bom-->
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>jdk-8-classpath</id>
            <activation>
                <!-- activate this on any JDK from 9 onwards -->
                <jdk>[9,)</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration>
                            <release>8</release>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>format</id>
            <activation>
                <activeByDefault>true</activeByDefault>
                <property>
                    <name>!no-format</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>net.revelc.code.formatter</groupId>
                        <artifactId>formatter-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>process-sources</phase>
                                <goals>
                                    <goal>format</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>net.revelc.code</groupId>
                        <artifactId>impsort-maven-plugin</artifactId>
                        <configuration>
                            <removeUnused>true</removeUnused>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sort-imports</id>
                                <goals>
                                    <goal>sort</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>validate</id>
            <activation>
                <activeByDefault>true</activeByDefault>
                <property>
                    <name>no-format</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>net.revelc.code.formatter</groupId>
                        <artifactId>formatter-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>process-sources</phase>
                                <goals>
                                    <goal>validate</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>net.revelc.code</groupId>
                        <artifactId>impsort-maven-plugin</artifactId>
                        <configuration>
                            <removeUnused>true</removeUnused>
                        </configuration>
                        <executions>
                            <execution>
                                <id>check-imports</id>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${nexus-staging-maven-plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <serverId>ossrh</serverId>
                            <autoReleaseAfterClose>false</autoReleaseAfterClose>
                            <keepStagingRepositoryOnCloseRuleFailure>true</keepStagingRepositoryOnCloseRuleFailure>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <!--
                        ## IMPORTANT ##
                        In your ~/.m2/settings.xml you need to add and edit the following profile:
                        <profile>
                            <id>release</id>
                            <properties>
                                <gpg.useagent>false</gpg.useagent>
                                <gpg.executable>/usr/local/Cellar/gnupg@1.4/1.4.23_1/bin/gpg1</gpg.executable> <- use gpg1 on Mac OS X
                                <gpg.homedir>~/.gnupg</gpg.homedir>  <- Update to your own directory
                                <gpg.passphrase>******</gpg.passphrase> <- Add your passphrase
                            </properties>
                        </profile>
                         -->
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>eclipse</id>
            <activation>
                <property>
                    <!-- This is a trick to have the profile automatically activated by Eclipse -->
                    <name>m2e.version</name>
                </property>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                        <plugin>
                            <groupId>org.eclipse.m2e</groupId>
                            <artifactId>lifecycle-mapping</artifactId>
                            <version>1.0.0</version>
                            <configuration>
                                <lifecycleMappingMetadata>
                                    <pluginExecutions>
                                        <pluginExecution>
                                            <pluginExecutionFilter>
                                                <groupId>io.fabric8</groupId>
                                                <artifactId>
                                                    docker-maven-plugin
                                                </artifactId>
                                                <versionRange>
                                                    [0.26.1,)
                                                </versionRange>
                                                <goals>
                                                    <goal>start</goal>
                                                    <goal>stop</goal>
                                                </goals>
                                            </pluginExecutionFilter>
                                            <action>
                                                <ignore></ignore>
                                            </action>
                                        </pluginExecution>
                                        <pluginExecution>
                                            <pluginExecutionFilter>
                                                <groupId>
                                                    org.apache.maven.plugins
                                                </groupId>
                                                <artifactId>
                                                    maven-antrun-plugin
                                                </artifactId>
                                                <versionRange>
                                                    [1.8,)
                                                </versionRange>
                                                <goals>
                                                    <goal>run</goal>
                                                </goals>
                                            </pluginExecutionFilter>
                                            <action>
                                                <ignore></ignore>
                                            </action>
                                        </pluginExecution>
                                        <pluginExecution>
                                            <pluginExecutionFilter>
                                                <groupId>
                                                    org.apache.maven.plugins
                                                </groupId>
                                                <artifactId>
                                                    maven-dependency-plugin
                                                </artifactId>
                                                <versionRange>
                                                    [3.1.1,)
                                                </versionRange>
                                                <goals>
                                                    <goal>resolve</goal>
                                                </goals>
                                            </pluginExecutionFilter>
                                            <action>
                                                <ignore></ignore>
                                            </action>
                                        </pluginExecution>
                                        <pluginExecution>
                                            <pluginExecutionFilter>
                                                <groupId>
                                                    org.jboss.jandex
                                                </groupId>
                                                <artifactId>
                                                    jandex-maven-plugin
                                                </artifactId>
                                                <versionRange>
                                                    [1.0.5,)
                                                </versionRange>
                                                <goals>
                                                    <goal>jandex</goal>
                                                </goals>
                                            </pluginExecutionFilter>
                                            <action>
                                                <ignore></ignore>
                                            </action>
                                        </pluginExecution>
                                        <pluginExecution>
                                            <pluginExecutionFilter>
                                                <groupId>io.quarkus</groupId>
                                                <artifactId>
                                                    quarkus-extension-plugin
                                                </artifactId>
                                                <versionRange>
                                                    [0.1.0,)
                                                </versionRange>
                                                <goals>
                                                    <goal>extension-list</goal>
                                                </goals>
                                            </pluginExecutionFilter>
                                            <action>
                                                <ignore></ignore>
                                            </action>
                                        </pluginExecution>
                                    </pluginExecutions>
                                </lifecycleMappingMetadata>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
    </profiles>
</project>
