<?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">
    <modelVersion>4.0.0</modelVersion>

    <groupId>io.confluent</groupId>
    <artifactId>resolver-maven-plugin</artifactId>
    <version>0.6.0</version>
    <packaging>maven-plugin</packaging>
    <name>Resolver Maven Plugin</name>

    <description>
        A Maven plugin for resolving a version range of an artifact to the highest matching version.
    </description>

    <developers>
        <developer>
            <name>Confluent Developer Prod Team</name>
            <email>tools@confluent.io</email>
            <organization>Confluent, Inc.</organization>
            <organizationUrl>https://confluent.io</organizationUrl>
        </developer>
    </developers>

    <url>https://github.com/confluentinc/resolver-maven-plugin</url>

    <licenses>
        <license>
            <name>The MIT License</name>
            <url>http://www.opensource.org/licenses/mit-license.php</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <properties>
        <mavenVersion>3.2.5</mavenVersion>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <github.global.server>github</github.global.server>
    </properties>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <scm>
        <url>http://github.com/confluentinc/resolver-maven-plugin</url>
        <connection>scm:git:git://github.com/confluentinc/resolver-maven-plugin.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/confluentinc/resolver-maven-plugin.git</developerConnection>
        <tag>resolver-maven-plugin-0.6.0</tag>
    </scm>

    <dependencies>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-model</artifactId>
            <version>${mavenVersion}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>${mavenVersion}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>${mavenVersion}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-artifact</artifactId>
            <version>${mavenVersion}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>3.4</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13</version>
            <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>versions-maven-plugin</artifactId>
          <version>2.7</version>
          <type>maven-plugin</type>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>mrm-maven-plugin</artifactId>
                <version>1.1.0</version>
                <executions>
                <execution>
                    <goals>
                    <goal>start</goal>
                    <goal>stop</goal>
                    </goals>
                </execution>
                </executions>
                <configuration>
                <propertyName>repository.proxy.url</propertyName>
                <repositories>
                    <mockRepo>
                    <source>src/it-repo</source>
                    </mockRepo>
                    <proxyRepo />
                </repositories>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-invoker-plugin</artifactId>
                <version>3.0.0</version>
                <configuration>
                    <projectsDirectory>src/it</projectsDirectory>
                    <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
                    <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
                    <settingsFile>src/it/settings.xml</settingsFile>
                    <showErrors>true</showErrors>
                    <streamLogs>true</streamLogs>
                    <!--
                        ! There seemed to be a problem with the indepance of the IT's
                        ! here. So we can't use more than one thread.
                        ! TODO: Dive more deeply into this problem.
                    -->
                    <parallelThreads>1</parallelThreads>
                    <pomIncludes>
                        <pomInclude>*/pom.xml</pomInclude>
                    </pomIncludes>
                    <postBuildHookScript>verify</postBuildHookScript>
                    <filterProperties>
                        <repository.proxy.url>${repository.proxy.url}</repository.proxy.url>
                    </filterProperties>
                    <mavenOpts>-Xmx256m</mavenOpts>
                </configuration>
                <executions>
                    <execution>
                        <id>integration-test</id>
                        <goals>
                        <goal>install</goal>
                        <goal>run</goal>
                        </goals>
                        <configuration>
                        <streamLogs>false</streamLogs>
                        <debug>true</debug>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- Staging for release to Maven Central. -->

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.1.1</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <!-- avoiding javadoc warnings caused by Mojo annotations -->
                    <detectJavaApiLink>false</detectJavaApiLink>
                    <tagletArtifacts>
                        <tagletArtifact>
                            <groupId>org.apache.maven.plugin-tools</groupId>
                            <artifactId>maven-plugin-tools-javadoc</artifactId>
                            <version>3.4</version>
                        </tagletArtifact>
                    </tagletArtifacts>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.4</version>
                <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-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>3.4</version>
                <configuration>
                    <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.4</version>
                <configuration>
                    <skipDeploy>true</skipDeploy>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>net.ju-n.maven.doxia</groupId>
                        <artifactId>doxia-module-markdown</artifactId>
                        <version>1.0.0</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.2</version>
                    <configuration>
                        <checkModificationExcludes>
                            <checkModificationExclude>pom.xml</checkModificationExclude>
                        </checkModificationExcludes>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <useReleaseProfile>false</useReleaseProfile>
                        <releaseProfiles>release</releaseProfiles>
                        <goals>deploy</goals>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.8</version>
                <configuration>
                    <dependencyDetailsEnabled>false</dependencyDetailsEnabled>
                    <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-invoker-plugin</artifactId>
                <reportSets>
                <reportSet>
                    <reports>
                    <report>report</report>
                    </reports>
                </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <profile>
            <id>jenkins</id>
            <activation>
                <property>
                    <name>env.BUILD_NUMBER</name>
                </property>
            </activation>
            <properties>
                <dependency.check.skip>false</dependency.check.skip>
            </properties>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.jacoco</groupId>
                            <artifactId>jacoco-maven-plugin</artifactId>
                            <version>0.8.5</version>
                        </plugin>
                    </plugins>
                </pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>pre-unit-test</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>report</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-checkstyle-plugin</artifactId>
                      <version>2.17</version>
                    </plugin>
                    <plugin>
                        <groupId>com.github.spotbugs</groupId>
                        <artifactId>spotbugs-maven-plugin</artifactId>
                        <version>3.1.12</version>
                        <configuration>
                            <effort>Max</effort>
                            <threshold>High</threshold>
                            <xmlOutput>true</xmlOutput>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <reporting>
                <plugins>
                    <plugin>
                        <groupId>com.github.spotbugs</groupId>
                        <artifactId>spotbugs-maven-plugin</artifactId>
                        <configuration>
                            <xmlOutput>true</xmlOutput>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <configuration>
                            <configLocation>checkstyle/checkstyle.xml</configLocation>
                            <suppressionsLocation>checkstyle/common-suppressions.xml</suppressionsLocation>
                            <!-- ${project.basedir}/src/main/java -->
                            <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
                            <encoding>UTF-8</encoding>
                            <consoleOutput>true</consoleOutput>
                            <failsOnError>false</failsOnError>
                            <failOnViolation>true</failOnViolation>
                            <includeResources>false</includeResources>
                            <includeTestResources>false</includeTestResources>
                        </configuration>
                        <reportSets>
                            <reportSet>
                                <reports>
                                    <report>checkstyle-aggregate</report>
                                </reports>
                            </reportSet>
                        </reportSets>
                    </plugin>
                </plugins>
            </reporting>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>maven-central</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <distributionManagement>
                <snapshotRepository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
            </distributionManagement>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.7</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>