<?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.skodjob</groupId>
    <artifactId>test-generator</artifactId>
    <packaging>pom</packaging>
    <version>0.4.0</version>

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

    <name>${project.groupId}:${project.artifactId}</name>
    <description>Generates metadata for junit tests</description>
    <url>https://github.com/skodjob/test-metadata-generator</url>

    <scm>
        <connection>scm:git:git:/github.com/skodjob/test-metadata-generator.git</connection>
        <developerConnection>scm:git:ssh://github.com/skodjob/test-metadata-generator.git</developerConnection>
        <url>https://github.com/skodjob/test-metadata-generator</url>
    </scm>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/skodjob/test-metadata-generator/issues</url>
    </issueManagement>

    <developers>
        <developer>
            <id>im-konge</id>
            <name>Lukáš Král</name>
            <email>lukywill16@gmail.com</email>
        </developer>
        <developer>
            <id>kornys</id>
            <name>David Kornel</name>
            <email>kornys@outlook.com</email>
        </developer>
        <developer>
            <id>Frawless</id>
            <name>Jakub Stejskal</name>
            <email>xstejs24@gmail.com</email>
        </developer>
    </developers>

    <properties>
        <generatorRootDirectory>${basedir}</generatorRootDirectory>

        <!-- Build tools -->
        <checkstyle.version>10.22.0</checkstyle.version>
        <spotbugs.version>4.9.3</spotbugs.version>

        <!-- Maven build versions & properties-->
        <maven.spotbugs.version>4.9.3.0</maven.spotbugs.version>
        <maven.checkstyle.version>3.6.0</maven.checkstyle.version>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.source.plugin.version>3.3.1</maven.source.plugin.version>
        <maven.deploy.plugin.version>3.1.4</maven.deploy.plugin.version>
        <maven.gpg.version>3.2.7</maven.gpg.version>
        <sonatype.nexus.central>0.7.0</sonatype.nexus.central>
        <maven.javadoc.version>3.11.2</maven.javadoc.version>
        <maven.assembly.version>3.7.1</maven.assembly.version>
        <maven.plugin.plugin.version>3.15.1</maven.plugin.plugin.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>${jupiter.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <distributionManagement>
        <repository>
            <id>github</id>
            <name>GitHub Apache Maven Packages</name>
            <url>https://maven.pkg.github.com/skodjob/test-metadata-generator</url>
        </repository>
    </distributionManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
                <version>${maven.spotbugs.version}</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-checkstyle-plugin</artifactId>
                <version>${maven.checkstyle.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>${checkstyle.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>validate</id>
                        <phase>validate</phase>
                        <configuration>
                            <configLocation>.checkstyle/checkstyle.xml</configLocation>
                            <suppressionsLocation>.checkstyle/suppressions.xml</suppressionsLocation>
                            <includeTestSourceDirectory>true</includeTestSourceDirectory>
                            <consoleOutput>true</consoleOutput>
                            <failsOnError>true</failsOnError>
                        </configuration>
                        <goals>
                            <goal>check</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>
                            <show>public</show>
                            <failOnError>true</failOnError>
                            <failOnWarnings>true</failOnWarnings>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>${maven.plugin.plugin.version}</version>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven.source.plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>${maven.deploy.plugin.version}</version>
                <executions>
                    <execution>
                        <id>deploy</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>default</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <modules>
                <module>test-docs-generator-maven-plugin</module>
                <module>dummy-module</module>
            </modules>
        </profile>
        <profile>
            <id>ossrh</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <modules>
                <module>test-docs-generator-maven-plugin</module>
            </modules>
            <properties>
                <!--suppress UnresolvedMavenProperty -->
                <gpg.executable>${env.GPG_EXECUTABLE}</gpg.executable>
                <!--suppress UnresolvedMavenProperty -->
                <gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
                <!--suppress UnresolvedMavenProperty -->
                <gpg.keyname>${env.GPG_KEYNAME}</gpg.keyname>
            </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>deploy</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.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>${sonatype.nexus.central}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <tokenAuth>true</tokenAuth>
                            <checksums>all</checksums>
                            <autoPublish>true</autoPublish>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <version>${maven.assembly.version}</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                                <configuration>
                                    <appendAssemblyId>false</appendAssemblyId>
                                    <tarLongFileMode>posix</tarLongFileMode>
                                    <descriptors>
                                        <descriptor>test-docs-generator-maven-plugin/src/main/assembly/dist.xml</descriptor>
                                    </descriptors>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
