<?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.strimzi</groupId>
    <artifactId>mirror-maker-2-extensions</artifactId>
    <version>1.2.0</version>

    <licenses>
		<license>
			<name>The Apache License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
		</license>
	</licenses>

    <name>Mirror Maker 2 Extensions</name>
    <description>Extensions for MirrorMaker2</description>
    <url>https://strimzi.io/</url>

    <scm>
        <connection>scm:git:git://github.com/strimzi/mirror-maker-2-extensions.git</connection>
        <developerConnection>scm:git:ssh://github.com:strimzi/mirror-maker-2-extensions.git</developerConnection>
        <url>https://github.com/strimzi/mirror-maker-2-extensions</url>
    </scm>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/strimzi/mirror-maker-2-extensions/issues</url>
    </issueManagement>

    <developers>
        <developer>
            <name>Tom Bentley</name>
            <email>tbentley@redhat.com</email>
            <organization>Red Hat</organization>
            <organizationUrl>https://www.redhat.com</organizationUrl>
        </developer>
        <developer>
            <name>Paolo Patierno</name>
            <email>ppatierno@live.com</email>
            <organization>Red Hat</organization>
            <organizationUrl>https://www.redhat.com</organizationUrl>
        </developer>
        <developer>
            <name>Jakub Scholz</name>
            <email>github@scholzj.com</email>
            <organization>Red Hat</organization>
            <organizationUrl>https://www.redhat.com</organizationUrl>
        </developer>
        <developer>
            <name>Sam Hawker</name>
            <email>sam.b.hawker@gmail.com</email>
            <organization>IBM</organization>
            <organizationUrl>https://www.ibm.com</organizationUrl>
        </developer>
        <developer>
            <name>Jakub Stejskal</name>
            <email>xstejs24@gmail.com</email>
            <organization>Red Hat</organization>
            <organizationUrl>https://www.redhat.com</organizationUrl>
        </developer>
    </developers>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.version>3.8.1</maven.compiler.version>
        <maven.surefire.version>3.0.0-M5</maven.surefire.version>
        <maven.assembly.version>3.1.0</maven.assembly.version>
        <maven.shade.version>3.1.0</maven.shade.version>
        <maven.javadoc.version>3.1.0</maven.javadoc.version>
        <maven.source.version>3.0.1</maven.source.version>
        <maven.dependency.version>3.1.1</maven.dependency.version>
        <maven.gpg.version>1.6</maven.gpg.version>
        <maven.checkstyle.version>3.1.0</maven.checkstyle.version>
        <spotbugs.version>4.0.3</spotbugs.version>
        <sonatype.nexus.staging>1.6.3</sonatype.nexus.staging>
        <jacoco.version>0.7.9</jacoco.version>
        <license.maven.version>2.11</license.maven.version>
        <maven-jar-plugin.version>3.1.0</maven-jar-plugin.version>

        <kafka.version>3.1.0</kafka.version>

        <!-- property to skip surefire tests during failsafe execution -->
        <skip.surefire.tests>${skipTests}</skip.surefire.tests>
	</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>

    <dependencies>
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>connect-mirror-client</artifactId>
            <version>${kafka.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    
    <build>
        <finalName>mm2-extensions</finalName>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven.compiler.version}</version>
                    <executions>
                        <execution>
                            <id>default-compile</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                            <configuration>
                                <compilerArgs>
                                    <arg>-Xlint:unchecked,deprecation</arg>
                                    <arg>-Werror</arg>
                                </compilerArgs>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>${maven.dependency.version}</version>
                    <dependencies>
                        <dependency>
                            <!-- Override dep to support Java 11,
                                 can remove this once maven.dependency.version >= 3.1.2
                                 see https://issues.apache.org/jira/browse/MDEP-613 -->
                            <groupId>org.apache.maven.shared</groupId>
                            <artifactId>maven-dependency-analyzer</artifactId>
                            <version>1.11.1</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <id>copy-dependencies</id>
                            <phase>none</phase>
                            <goals>
                                <goal>copy-dependencies</goal>
                            </goals>
                            <configuration>
                                <includeScope>runtime</includeScope>
                                <outputDirectory>${project.build.directory}/lib</outputDirectory>
                                <prependGroupId>true</prependGroupId>
                                <overWriteReleases>false</overWriteReleases>
                                <overWriteSnapshots>false</overWriteSnapshots>
                                <overWriteIfNewer>true</overWriteIfNewer>
                            </configuration>
                        </execution>
                        <execution>
                            <id>set-classpath</id>
                            <phase>none</phase>
                            <goals>
                                <goal>build-classpath</goal>
                            </goals>
                            <configuration>
                                <includeScope>runtime</includeScope>
                                <outputProperty>project.dist.classpath</outputProperty>
                                <attach>false</attach>
                                <prefix>lib</prefix>
                                <prependGroupId>true</prependGroupId>
                                <overWriteReleases>false</overWriteReleases>
                                <overWriteSnapshots>false</overWriteSnapshots>
                                <overWriteIfNewer>true</overWriteIfNewer>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${maven.checkstyle.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>8.29</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>validate</id>
                        <phase>validate</phase>
                        <configuration>
                            <configLocation>.checkstyle/checkstyle.xml</configLocation>
                            <headerLocation>.checkstyle/java.header</headerLocation>
                            <suppressionsLocation>.checkstyle/suppressions.xml</suppressionsLocation>
                            <includeTestSourceDirectory>true</includeTestSourceDirectory>
                            <encoding>UTF-8</encoding>
                            <consoleOutput>true</consoleOutput>
                            <failsOnError>true</failsOnError>
                        </configuration>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <propertyName>surefireArgLine</propertyName>
                        </configuration>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>package</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <inherited>true</inherited>
                <version>${maven.surefire.version}</version>
                <configuration>
                    <environmentVariables>
                        <ENV_VAR_EXISTS>value</ENV_VAR_EXISTS>
                        <ENV_VAR_EXISTS_BOOLEAN>true</ENV_VAR_EXISTS_BOOLEAN>
                    </environmentVariables>
                    <trimStackTrace>false</trimStackTrace>
                    <forkCount>1</forkCount>
                    <!-- This is workaround for https://issues.apache.org/jira/browse/SUREFIRE-1809 -->
                    <useModulePath>false</useModulePath>
                    <skipTests>${skip.surefire.tests}</skipTests>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>${license.maven.version}</version>
                <configuration>
                    <aggregate>true</aggregate>
                    <header>header.txt</header>
                    <properties>
                        <owner>Red Hat, Inc.</owner>
                    </properties>
                    <excludes>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
                <version>4.0.0</version><dependencies>
                <!-- overwrite dependency on spotbugs if you want to specify the version of˓→spotbugs -->
                <dependency>
                    <groupId>com.github.spotbugs</groupId>
                    <artifactId>spotbugs</artifactId>
                    <version>${spotbugs.version}</version>
                </dependency></dependencies>
                <configuration>
                    <effort>Max</effort>
                    <!-- Reports all bugs (other values are medium and max) -->
                    <threshold>Low</threshold>
                    <!-- Produces XML report -->
                    <xmlOutput>true</xmlOutput>
                    <!-- Configures the directory in which the XML report is created -->
                    <spotbugsXmlOutputDirectory>${project.build.directory}/spotbugs</spotbugsXmlOutputDirectory>
                    <!-- Configures the file for excluding warnings -->
                    <excludeFilterFile>${project.basedir}/.spotbugs/spotbugs-exclude.xml</excludeFilterFile>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>${maven.dependency.version}</version>
                <executions>
                    <execution>
                        <id>analyze</id>
                        <goals>
                            <goal>analyze-only</goal>
                        </goals>
                        <configuration>
                            <failOnWarning>true</failOnWarning>
                            <ignoredUnusedDeclaredDependencies>
                            </ignoredUnusedDeclaredDependencies>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven.source.version}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven.javadoc.version}</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <sourcepath>${project.build.sourceDirectory}:${project.build.directory}/generated-sources/annotations</sourcepath>
                            <show>public</show>
                            <failOnError>true</failOnError>
                            <failOnWarnings>true</failOnWarnings>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven-jar-plugin.version}</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
                <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.0.0-M2</version>
                <executions>
                    <execution>
                        <id>enforce-banned-dependencies</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <bannedDependencies>
                                    <excludes>
                                        <!-- use org.apache.logging.log4j:log4j-slf4j-impl -->
                                        <exclude>ch.qos.logback:*</exclude>
                                        <!-- use org.apache.logging.log4j:log4j-1.2-api shim -->
                                        <exclude>log4j:log4j:*:jar:compile</exclude>
                                        <!-- use org.apache.logging.log4j:log4j-slf4j-impl -->
                                        <exclude>org.slf4j:slf4j-log4j12:*:jar:compile</exclude>
                                    </excludes>
                                </bannedDependencies>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>ossrh</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <!--suppress UnresolvedMavenProperty -->
                <gpg.executable>${env.GPG_EXECUTABLE}</gpg.executable>
                <!--suppress UnresolvedMavenProperty -->
                <gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven.gpg.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--batch</arg>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${sonatype.nexus.staging}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>false</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

    </profiles>

</project>