<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2022 ajaxer.org
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

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

    <parent>
        <groupId>org.ajaxer</groupId>
        <artifactId>parent</artifactId>
        <version>0.0.7</version>
    </parent>

    <groupId>com.github.ershakiransari</groupId>
    <artifactId>hello-world</artifactId>
    <version>0.8.8</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>
        <module>hello-java</module>
    </modules>

    <properties>
        <id-ossrh>ossrh-ershakiransari</id-ossrh>
    </properties>

    <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.8.8</tag>
    </scm>

    <developers>
        <developer>
            <name>Shakir Ansari</name>
            <roles>
                <role>developer</role>
            </roles>
            <url>https://github.com/ErShakirAnsari</url>
        </developer>
    </developers>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!-- nexus-staging-maven-plugin -->
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <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>

                    <!--maven-resources-plugin-->
                    <plugin>
                        <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-resources-plugin -->
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-resources-plugin</artifactId>
                        <version>3.3.0</version>
                        <configuration>
                            <outputDirectory>${basedir}</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>docs</directory>
                                    <filtering>true</filtering>
                                </resource>
                                <resource>
                                    <directory>${basedir}/src/main/resources-dev</directory>
                                </resource>
                            </resources>
                        </configuration>
                        <executions>
                            <execution>
                                <id>copy-resources</id>
                                <!-- here the phase you need -->
                                <phase>validate</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <plugins>
            <!--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>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
