<!--
~   Licensed 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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.basepom</groupId>
        <artifactId>basepom-oss</artifactId>
        <version>33</version>
    </parent>

    <groupId>org.basepom.maven</groupId>
    <artifactId>duplicate-finder-maven-plugin</artifactId>
    <packaging>maven-plugin</packaging>

    <version>1.5.1</version>
    <name>duplicate-finder-maven-plugin Maven Mojo</name>

    <description>
        The Maven duplicate-finder plugin provides goals to check the various maven scoped classpaths (compile, runtime, test) for duplicate classes and resources.
    </description>

    <url>https://github.com/basepom/duplicate-finder-maven-plugin</url>

    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git://github.com/basepom/duplicate-finder-maven-plugin.git</connection>
        <developerConnection>scm:git:git://github.com/basepom/duplicate-finder-maven-plugin.git</developerConnection>
        <url>https://github.com/basepom/duplicate-finder-maven-plugin</url>
        <tag>duplicate-finder-maven-plugin-1.5.1</tag>
    </scm>

    <repositories>
        <repository>
            <id>snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
            <releases>
                <enabled>false</enabled>
                <updatePolicy>never</updatePolicy>
                <checksumPolicy>warn</checksumPolicy>
            </releases>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>interval:180</updatePolicy>
                <checksumPolicy>fail</checksumPolicy>
            </snapshots>
        </repository>
    </repositories>

    <issueManagement>
        <system>Github</system>
        <url>https://github.com/basepom/duplicate-finder-maven-plugin/issues</url>
    </issueManagement>

    <developers>
        <developer>
            <id>tomdz</id>
            <name>Thomas Dudziak</name>
            <url>http://tomdz.org</url>
            <timezone>-8</timezone>
        </developer>
        <developer>
            <id>hgschmie</id>
            <name>Henning Schmiedehausen</name>
            <timezone>-8</timezone>
        </developer>
    </developers>

    <contributors>
        <contributor>
            <name>Conny Kreyssel</name>
        </contributor>
    </contributors>

    <properties>
        <project.build.systemJdk>11</project.build.systemJdk>
        <project.build.targetJdk>8</project.build.targetJdk>
        <!-- Activate an IT profile to run integration tests -->
        <basepom.it.skip>true</basepom.it.skip>
        <basepom.it.parallel>8</basepom.it.parallel>

        <dep.maven-api.version>3.0</dep.maven-api.version>
        <dep.plexus.version>2.0.0</dep.plexus.version>
        <dep.groovy.version>3.0.5</dep.groovy.version>
        <dep.slf4j.version>1.7.28</dep.slf4j.version>
        <dep.guava.version>28.1-jre</dep.guava.version>

        <dep.plugin.plugin.version>3.6.0</dep.plugin.plugin.version>
        <dep.plugin.gmavenplus.plugin>1.10.0</dep.plugin.gmavenplus.plugin>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>${dep.maven-api.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.sonatype.sisu</groupId>
                    <artifactId>sisu-inject-plexus</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>${dep.plugin.plugin.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-model</artifactId>
            <version>${dep.maven-api.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-artifact</artifactId>
            <version>${dep.maven-api.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>${dep.maven-api.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.maven.reporting</groupId>
                    <artifactId>maven-reporting-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.maven.wagon</groupId>
                    <artifactId>wagon-file</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.maven.wagon</groupId>
                    <artifactId>wagon-http-lightweight</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.maven.wagon</groupId>
                    <artifactId>wagon-ssh</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.maven.wagon</groupId>
                    <artifactId>wagon-ssh-external</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>commons-cli</groupId>
                    <artifactId>commons-cli</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>classworlds</groupId>
                    <artifactId>classworlds</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.codehaus.plexus</groupId>
                    <artifactId>plexus-interactivity-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.sonatype.sisu</groupId>
                    <artifactId>sisu-inject-plexus</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${dep.guava.version}</version>
        </dependency>

        <dependency>
            <groupId>net.jcip</groupId>
            <artifactId>jcip-annotations</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <version>3.0.2</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${dep.slf4j.version}</version>
        </dependency>

        <dependency>
            <groupId>org.codehaus.woodstox</groupId>
            <artifactId>stax2-api</artifactId>
            <version>3.1.4</version>
        </dependency>

        <dependency>
            <groupId>org.codehaus.woodstox</groupId>
            <artifactId>woodstox-core-asl</artifactId>
            <version>4.4.1</version>
            <scope>runtime</scope>
            <exclusions>
                <exclusion>
                    <artifactId>stax-api</artifactId>
                    <groupId>javax.xml.stream</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.staxmate</groupId>
            <artifactId>staxmate</artifactId>
            <version>2.2.1</version>
            <exclusions>
                <exclusion>
                    <artifactId>stax-api</artifactId>
                    <groupId>javax.xml.stream</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy</artifactId>
            <version>${dep.groovy.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-xml</artifactId>
            <version>${dep.groovy.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <version>${dep.plugin.plugin.version}</version>
                    <configuration>
                        <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.plexus</groupId>
                    <artifactId>plexus-component-metadata</artifactId>
                    <version>${dep.plexus.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.gmavenplus</groupId>
                    <artifactId>gmavenplus-plugin</artifactId>
                    <version>${dep.plugin.gmavenplus.plugin}</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <configuration>
                    <rules combine.children="append">
                        <requireProperty>
                            <property>project.build.targetJdk</property>
                            <regex>^8$</regex>
                            <regexMessage>Project must be built with JDK8 target. Do not specify an integration profile while building.</regexMessage>
                        </requireProperty>
                    </rules>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <executions>
                    <execution>
                        <id>mojo-descriptor</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>descriptor</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>help-goal</id>
                        <goals>
                            <goal>helpmojo</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.plexus</groupId>
                <artifactId>plexus-component-metadata</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate-metadata</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.gmavenplus</groupId>
                <artifactId>gmavenplus-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>addTestSources</goal>
                            <goal>compileTests</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <configuration>
                    <mapping>
                        <groovy>SLASHSTAR_STYLE</groovy>
                    </mapping>
                    <excludes combine.children="append">
                        <exclude>**/conflict-different-content</exclude>
                        <exclude>**/conflict-same-content</exclude>
                    </excludes>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <configuration>
                    <excludeRoots combine.children="append">
                        <excludeRoot>target/generated-sources/plugin</excludeRoot>
                    </excludeRoots>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-invoker-plugin</artifactId>
                <configuration>
                    <!-- Allows access to the groovy utility class in the test source tree. -->
                    <addTestClassPath>true</addTestClassPath>
                    <filterProperties>
                        <project.it.enforce>${project.it.enforce}</project.it.enforce>
                    </filterProperties>
                </configuration>

                <!-- dependency for verify.groovy scripts -->
                <dependencies>
                    <dependency>
                        <groupId>com.google.guava</groupId>
                        <artifactId>guava</artifactId>
                        <version>${dep.guava.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy</artifactId>
                        <version>${dep.groovy.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-xml</artifactId>
                        <version>${dep.groovy.version}</version>
                    </dependency>
                </dependencies>
            </plugin>

            <!-- Use Jacoco with the invoker plugin
                 for integration test coverage.
            -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-it</id>
                        <configuration>
                            <destFile>${project.build.directory}/jacoco-it.exec</destFile>
                            <propertyName>invoker.mavenOpts</propertyName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <!-- do not activate IT profiles during a regular build, it would end up building a
         plugin that would not run on a lower version of Java
    -->
    <profiles>
        <profile>
            <id>it-jdk14</id>
            <properties>
                <project.build.targetJdk>14</project.build.targetJdk>
                <project.it.enforce>[14,15)</project.it.enforce>
                <basepom.it.skip>false</basepom.it.skip>
            </properties>
        </profile>
        <profile>
            <id>it-jdk11</id>
            <properties>
                <project.build.targetJdk>11</project.build.targetJdk>
                <project.it.enforce>[11,12)</project.it.enforce>
                <basepom.it.skip>false</basepom.it.skip>
            </properties>
        </profile>
        <profile>
            <id>it-jdk8</id>
            <properties>
                <project.build.targetJdk>8</project.build.targetJdk>
                <project.it.enforce>[1.8,9)</project.it.enforce>
                <basepom.it.skip>false</basepom.it.skip>
            </properties>
        </profile>
    </profiles>
</project>
