<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>com.antwerkz.github</groupId>
    <artifactId>issues-maven-plugin-parent</artifactId>
    <packaging>pom</packaging>
    <version>1.1.12</version>

    <name>Github Issues Maven Plugin</name>
    <url>https://github.com/evanchooly/github-issues-maven-plugin</url>

    <scm>
        <connection>scm:git:git@github.com:evanchooly/github-issues-maven-plugin.git</connection>
        <developerConnection>scm:git:git@github.com:evanchooly/github-issues-maven-plugin.git</developerConnection>
        <url>git@github.com:evanchooly/github-issues-maven-plugin.git</url>
    </scm>

    <properties>
        <kotlin.version>1.7.20</kotlin.version>
        <junit.version>4.13.2</junit.version>
        <maven.version>3.8.6</maven.version>
        <maven.plugin.version>3.6.4</maven.plugin.version>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <downloadSources>true</downloadSources>
        <nexus.url>https://oss.sonatype.org</nexus.url>
    </properties>

    <repositories>
        <repository>
            <id>central snapshots</id>
            <url>${nexus.url}/content/repositories/snapshots</url>
        </repository>
    </repositories>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>3.3.0</version>
                    <executions>
                        <execution>
                            <phase>generate-sources</phase>
                            <goals>
                                <goal>add-source</goal>
                            </goals>
                            <configuration>
                                <sources>
                                    <source>${project.basedir}/src/main/java</source>
                                    <source>${project.basedir}/src/main/kotlin</source>
                                </sources>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.10.1</version>
                    <configuration>
                        <source>11</source>
                        <target>11</target>
                        <compilerArgument>-proc:none</compilerArgument>
                        <compilerArgument>-Xlint:deprecation</compilerArgument>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.jetbrains.kotlin</groupId>
                    <artifactId>kotlin-maven-plugin</artifactId>
                    <version>${kotlin.version}</version>
                    <executions>
                        <execution>
                            <id>compile</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>test-compile</id>
                            <phase>test-compile</phase>
                            <goals>
                                <goal>test-compile</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <javaParameters>true</javaParameters>
                        <jvmTarget>11</jvmTarget>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.6.13</version>
                    <configuration>
                        <serverId>central</serverId>
                        <nexusUrl>${nexus.url}</nexusUrl>
                        <autoReleaseAfterClose>true</autoReleaseAfterClose>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <distributionManagement>
        <snapshotRepository>
            <id>central</id>
            <url>${nexus.url}/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>central</id>
            <url>${nexus.url}/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>publication</id>
            <activation>
                <property>
                    <name>release</name>
                </property>
            </activation>
            <properties>
                <skipTests>true</skipTests>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <version>3.1.0</version>
                        <executions>
                            <execution>
                                <id>enforce-environment-variable-is-set</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <requireEnvironmentVariable>
                                            <variableName>MAVEN_USERNAME</variableName>
                                        </requireEnvironmentVariable>
                                        <requireEnvironmentVariable>
                                            <variableName>MAVEN_CENTRAL_TOKEN</variableName>
                                        </requireEnvironmentVariable>
                                        <requireEnvironmentVariable>
                                            <variableName>MAVEN_GPG_PASSPHRASE</variableName>
                                        </requireEnvironmentVariable>
                                    </rules>
                                    <fail>true</fail>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>com.coderplus.maven.plugins</groupId>
                        <artifactId>copy-rename-maven-plugin</artifactId>
                        <version>1.0.1</version>
                        <executions>
                            <execution>
                                <id>copy-license-file</id>
                                <goals>
                                    <goal>copy</goal>
                                </goals>
                                <phase>generate-sources</phase>
                                <configuration>
                                    <sourceFile>${session.executionRootDirectory}/LICENSE</sourceFile>
                                    <destinationFile>${project.build.outputDirectory}/META-INF/LICENSE-${project.artifactId}</destinationFile>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.4.1</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <attach>true</attach>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.2.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <attach>true</attach>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>gpg</id>
            <activation>
                <property>
                    <name>release</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>remote-deploy</id>
            <activation>
                <property>
                    <name>release</name>
                </property>
            </activation>
            <build>
                <defaultGoal>deploy</defaultGoal>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.sonatype.plugins</groupId>
                            <artifactId>nexus-staging-maven-plugin</artifactId>
                            <version>1.6.13</version>
                            <extensions>true</extensions>
                            <configuration>
                                <serverId>central</serverId>
                                <nexusUrl>${nexus.url}</nexusUrl>
                                <autoReleaseAfterClose>true</autoReleaseAfterClose>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
        <profile>
            <id>local-deploy</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <distributionManagement>
                <snapshotRepository>
                    <id>local-snapshot</id>
                    <url>file://${local.repository.path}/snapshot</url>
                </snapshotRepository>
                <repository>
                    <id>local-release</id>
                    <url>file://${local.repository.path}/release</url>
                </repository>
            </distributionManagement>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-clean-plugin</artifactId>
                        <version>3.2.0</version>
                        <inherited>false</inherited>
                        <configuration>
                            <filesets>
                                <fileset>
                                    <directory>${local.repository.path}</directory>
                                </fileset>
                            </filesets>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <version>3.1.0</version>
                        <inherited>false</inherited>
                        <executions>
                            <execution>
                                <id>generate-repository-directories</id>
                                <phase>generate-sources</phase>
                                <configuration>
                                    <target>
                                        <mkdir dir="${local.repository.path}/snapshot" />
                                        <mkdir dir="${local.repository.path}/release" />
                                    </target>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <modules>
        <module>plugin</module>
        <module>test</module>
    </modules>

</project>
