<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">

    <groupId>com.github.ershakiransari</groupId>
    <artifactId>hello-world</artifactId>
    <version>0.3.0</version>

    <name>Hello World</name>
    <url>https://github.com/ErShakirAnsari/hello-world</url>
    <description>Hello world</description>

    <modelVersion>4.0.0</modelVersion>
    <packaging>pom</packaging>

    <modules>
        <module>hello-maven</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <id-ossrh>ossrh-ershakiransari</id-ossrh>

        <!--version-->
        <version.maven-gpg-plugin>3.0.1</version.maven-gpg-plugin>
        <version.maven-source-plugin>3.2.0</version.maven-source-plugin>
        <version.maven-javadoc-plugin>3.2.0</version.maven-javadoc-plugin>
        <version.nexus-staging-maven-plugin>1.6.7</version.nexus-staging-maven-plugin>
    </properties>

    <build>
        <plugins>
            <!--maven-jar-plugin-->
            <plugin>
                <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-jar-plugin -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.2</version>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>com.github.ershakiransari.HelloMaven</mainClass>
                            <addDefaultImplementationEntries>
                                true
                            </addDefaultImplementationEntries>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>

            <!--maven-release-plugin-->
            <plugin>
                <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-release-plugin -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>3.0.0-M6</version>
                <configuration>
                    <!--<tagNameFormat>${project.artifactId}-v${project.version}</tagNameFormat>-->
                    <tagNameFormat>v@{project.version}</tagNameFormat>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <releaseProfiles>release</releaseProfiles>
                    <scmCommentPrefix>[RELEASE]</scmCommentPrefix>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <!--release-manually-->
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!--maven-gpg-plugin-->
                    <plugin>
                        <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-gpg-plugin -->
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${version.maven-gpg-plugin}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <!--<configuration>
                                    <useAgent>true</useAgent>
                                    &lt;!&ndash;suppress MavenModelInspection &ndash;&gt;
                                    <keyname>${gpg.keyname}</keyname>
                                    &lt;!&ndash;suppress MavenModelInspection &ndash;&gt;
                                    <passphraseServerId>${gpg.keyname}</passphraseServerId>

                                    <gpgArguments>
										<arg>&#45;&#45;batch</arg>
                                        <arg>&#45;&#45;pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>-->
                            </execution>
                        </executions>
                    </plugin>

                    <!--maven-source-plugin-->
                    <plugin>
                        <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-source-plugin -->
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${version.maven-source-plugin}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!--maven-javadoc-plugin-->
                    <plugin>
                        <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-javadoc-plugin -->
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${version.maven-javadoc-plugin}</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <!-- add this to disable checking -->
                                    <doclint>none</doclint>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- nexus-staging-maven-plugin -->
                    <plugin>
                        <!-- https://mvnrepository.com/artifact/org.sonatype.plugins/nexus-staging-maven-plugin -->
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${version.nexus-staging-maven-plugin}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>${id-ossrh}</serverId>
                            <!-- below url will be provided by sonatype in you JIRA issue -->
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!--release-with-github-action-->
        <profile>
            <id>release-with-github-action</id>
            <build>
                <plugins>
                    <!--maven-gpg-plugin-->
                    <plugin>
                        <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-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>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <!--maven-source-plugin-->
                    <plugin>
                        <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-source-plugin -->
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${version.maven-source-plugin}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!--maven-javadoc-plugin-->
                    <plugin>
                        <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-javadoc-plugin -->
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${version.maven-javadoc-plugin}</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <!-- add this to disable checking -->
                                    <doclint>none</doclint>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- nexus-staging-maven-plugin -->
                    <plugin>
                        <!-- https://mvnrepository.com/artifact/org.sonatype.plugins/nexus-staging-maven-plugin -->
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${version.nexus-staging-maven-plugin}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>${id-ossrh}</serverId>
                            <!-- below url will be provided by sonatype in you JIRA issue -->
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <distributionManagement>
        <snapshotRepository>
            <id>${id-ossrh}</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>${id-ossrh}</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
    </distributionManagement>

    <scm>
        <connection>scm:git:https://github.com/ErShakirAnsari/hello-world.git</connection>
        <developerConnection>scm:git:https://github.com/ErShakirAnsari/hello-world.git</developerConnection>
        <url>https://github.com/ErShakirAnsari/hello-world/</url>
        <tag>v0.2.3</tag>
    </scm>

    <licenses>
        <license>
            <name>Apache 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>dev-id</id>
            <name>Shakir Ansari</name>
            <roles>
                <role>developer</role>
            </roles>
        </developer>
    </developers>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
