<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.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>9</version>
    </parent>

    <groupId>pl.project13.maven</groupId>
    <artifactId>git-commit-id-plugin-parent</artifactId>
    <packaging>pom</packaging>
    <version>4.0.1</version>
    <name>Git Commit Id Plugin Parent</name>
    <url>http://www.blog.project13.pl</url>

    <developers>
        <developer>
            <id>ktoso</id>
            <name>Konrad Malawski</name>
            <email>konrad.malawski@java.pl</email>
            <organization>project13.pl</organization>
            <url>http://blog.project13.pl</url>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>GNU Lesser General Public License 3.0</name>
            <url>http://www.gnu.org/licenses/lgpl-3.0.txt</url>
        </license>
    </licenses>

    <scm>
        <url>git@github.com:git-commit-id/git-commit-id-maven-plugin.git</url>
        <connection>scm:git@github.com:git-commit-id/git-commit-id-maven-plugin</connection>
        <developerConnection>scm:git:git@github.com:git-commit-id/git-commit-id-maven-plugin.git</developerConnection>
      <tag>v4.0.1</tag>
  </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <java.target>1.8</java.target>
    </properties>

    <modules>
        <module>core</module>
        <module>maven</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>git-commit-id-plugin-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.code.findbugs</groupId>
                <artifactId>jsr305</artifactId>
                <version>3.0.2</version>
                <optional>true</optional>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>1.8</version>
                </plugin>
                <plugin>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <plugin>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.1.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.3</version>
                </plugin>
                <plugin>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>1.4.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.0</version>
                </plugin>
                <plugin>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>1.6</version>
                </plugin>
                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <plugin>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <version>${maven-plugin-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.22.0</version>
                </plugin>
                <plugin>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.7.1</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <!-- if you would like to run the git-commit-id-plugin for your build, you could also include it here instead using a profile (see README.md) -->
            <!-- Setting built-in java compiler properties -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${java.target}</source>
                    <target>${java.target}</target>
                    <compilerArgument>-Xlint:deprecation</compilerArgument>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <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>

    <profiles>
        <profile>
            <id>gpg</id>
            <build>
                <plugins>
                    <!-- GPG -->
                    <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>coveralls</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.eluder.coveralls</groupId>
                        <artifactId>coveralls-maven-plugin</artifactId>
                        <version>4.3.0</version>
                        <!-- repo token is passed via -DrepoToken=yourcoverallsprojectrepositorytoken -->
                    </plugin>
                    <!-- cobertura-maven-plugin doesn't support java 8 https://github.com/mojohaus/cobertura-maven-plugin/issues/21-->
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>0.8.2</version>
                        <executions>
                            <execution>
                                <id>prepare-agent</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>checkstyle</id>
            <properties>
                <maven-checkstyle-plugin.version>3.1.0</maven-checkstyle-plugin.version>
                <!--  if you update the checkstyle version make sure you update the google_checks.xml inside the repository -->
                <checkstyle.version>8.25</checkstyle.version>
                <checkstyle.config.path>${basedir}/.github/.checkstyle</checkstyle.config.path>
            </properties>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-checkstyle-plugin</artifactId>
                            <version>${maven-checkstyle-plugin.version}</version>
                            <dependencies>
                                <dependency>
                                    <groupId>com.puppycrawl.tools</groupId>
                                    <artifactId>checkstyle</artifactId>
                                    <version>${checkstyle.version}</version>
                                </dependency>
                            </dependencies>
                        </plugin>
                    </plugins>
                </pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <version>${maven-checkstyle-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>validate</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                                <configuration>
                                    <configLocation>${checkstyle.config.path}/google_checks_checkstyle_${checkstyle.version}.xml</configLocation>
                                    <suppressionsLocation>${checkstyle.config.path}/checkstyle-suppressions.xml</suppressionsLocation>
                                    <propertyExpansion>samedir=${checkstyle.config.path}</propertyExpansion>
                                    <includeTestSourceDirectory>true</includeTestSourceDirectory>
                                    <encoding>${project.reporting.outputEncoding}</encoding>
                                    <consoleOutput>true</consoleOutput>
                                    <violationSeverity>warning</violationSeverity>
                                    <failsOnError>true</failsOnError>
                                    <failOnViolation>true</failOnViolation>
                                    <linkXRef>false</linkXRef>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <!--
            ugly hack when we run checkstyle in a submodule
            we want to find the right config and ${maven.multiModuleProjectDirectory} seems only available with maven 3.6
            and ${session.executionRootDirectory} does only work from the parent module
        -->
        <profile>
            <id>checkstyle-root-dir</id>
            <activation>
                <file>
                    <exists>${basedir}/../.github/.checkstyle</exists>
                </file>
            </activation>
            <properties>
                <checkstyle.config.path>${basedir}/../.github/.checkstyle</checkstyle.config.path>
            </properties>
        </profile>
    </profiles>
</project>
