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

	<name>${project.groupId}:${project.artifactId}</name>
	<groupId>org.asux</groupId>
	<artifactId>common</artifactId>
    
    <version>1.0</version>
    <inceptionYear>2019</inceptionYear>
    <description>common JAVA interfaces, abstract classes and utility classes</description>
	<url>https://github.com/seetamraju/org.ASUX.common</url>

    <properties>
        <!-- Properties added here are globally useable -->
        <DEVELOPMENT>/mnt/development</DEVELOPMENT>
        <TARGETROOT>/var/build</TARGETROOT>
        <TARGETDIR>${TARGETROOT}/${project.groupId}-${project.artifactId}-${project.version}</TARGETDIR>
        <!-- default encoding -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>8</java.version>
        <!-- see http://stackoverflow.com/questions/3017695/how-to-configure-encoding-in-maven -->
        <!-- see http://maven.apache.org/general.html#encoding-warning -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <!-- to prevent mvn warnings about platform specific encodings ... -->
    </properties>

	<licenses>
		<license>
			<name>BSD 3-Clause License</name>
			<url>https://opensource.org/licenses/BSD-3-Clause</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

    <developers>
        <developer>
            <name>Udaybhaskar Sarma Seetamraju</name>
            <email>tosarma@gmail.com</email>
            <organization>ASUX.org</organization>
            <organizationUrl>https://ASUX.org</organizationUrl>
            <roles>
                <role>Developer</role>
            </roles>
            <timezone>0</timezone>
        </developer>
    </developers>

	<contributors>
	</contributors>

    <scm>
		<url>http://github.com/org-asux/org.ASUX.common.git</url>
		<connection>scm:git:git@github.com:org-asux/org.ASUX.common.git</connection>
		<developerConnection>scm:git:git@github.com:org-asux/org.ASUX.common.git</developerConnection>
		<tag>HEAD</tag>
	</scm>

    <!-- https://central.sonatype.org/pages/apache-maven.html -->
    <!-- to use GPG to sign the software package - before it can be uploaded to Maven's Central Repository -->
    <!-- https://central.sonatype.org/pages/ossrh-guide.html -->
    <!-- This relies on the JIRA account from  issues.sonatype.org;  See details in ~/.2m/settings.xml -->
    <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>

    <dependencies>
        <dependency>
            <!-- scope>test</scope -->
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.2</version>
            </dependency>
        <!-- https://mvnrepository.com/artifact/commons-cli/commons-cli -->
        <dependency>
            <groupId>commons-cli</groupId>
            <artifactId>commons-cli</artifactId>
            <version>1.4</version>
        </dependency>
	</dependencies>

	<build>
        <directory>${TARGETDIR}</directory>
        <outputDirectory>${TARGETDIR}/classes</outputDirectory>
        <testOutputDirectory>${TARGETDIR}/test-classes</testOutputDirectory>
        <!-- sourceDirectory>../../src</sourceDirectory -->
        <sourceDirectory>src</sourceDirectory>

        <filters>
            <!-- filter>src/main/filters/${project.groupId}-${project.artifactId}-${project.version}.properties</filter -->
            <!-- The "KVname=KVvalue" pairs defined within the filter files replace ${ KVname } strings within resources on build -->
        </filters>

        <!-- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -->
		<plugins>
			<plugin>
                <inherited>true</inherited>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version> <!-- http://mvnrepository.com/artifact/org.apache.maven.plugins/maven-compiler-plugin -->
				<configuration>
                    <!-- release>11</release --> <!-- this 'release' flag is supported by Official JDK11 ONLY -->
                    <source>8</source>
                    <target>8</target>
                    <compilerArgs>
                        <arg>-Xlint:deprecation</arg>
                        <arg>-Xlint:unchecked</arg>
                        <!-- arg>-Xlint:all,-options,-path</arg -->
                    </compilerArgs>
                    <useIncrementalCompilation>yes</useIncrementalCompilation>
				</configuration>
			</plugin>

            <!-- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -->
            <plugin>
                <inherited>true</inherited>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.6</version> <!-- http://mvnrepository.com/artifact/org.apache.maven.plugins/maven-jar-plugin -->
                <configuration>
                    <finalName>${project.groupId}-${project.artifactId}-${project.version}</finalName>  <!-- Default value is: ${project.build.finalName} -->
                    <archive>
                        <!-- Generating a manifest classpath -->
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <mainClass>your.pom.did.not.overwrite.Jar-plugin-manifest.from.pom-jar.xml</mainClass>
                            <!-- https://maven.apache.org/shared/maven-archiver/examples/classpath.html#Prefix -->
                            <addClasspath>true</addClasspath> <!-- add the classpath of your project to the manifest -->
                            <!-- Maven style classpaths??? - Use: <classpathLayoutType>{repository | simple}</classpathLayoutType>  -->
                            <!-- classpathPrefix>lib/</classpathPrefix -->
                        </manifest>

                        <!-- ONLY sample here... This section is MANDATORY  in child POM ... -->
                        <manifestEntries>
                            <Manifest-Version>1.0</Manifest-Version>
                            <ProjectName>${project.artifactId}</ProjectName>
                            <AppName>${project.groupId}-${project.artifactId}</AppName>
                            <AppVersion>${project.version}</AppVersion>
                            <ArtifactFileName>${project.finalName}</ArtifactFileName>
                            <Datetime>${maven.build.timestamp}</Datetime>
                            <Date>Date-only not implemented</Date>
                            <BuildVersion>NOT IMPLEMENTED AUTO-INCR in scripts - ${buildNumber}</BuildVersion>
                            <Built-By>${user.name} - Seetamraju Uday Bhaskar Sarma sarma@ussmoso.com</Built-By>
                        </manifestEntries>

                        <!-- end Sample -->
                        <!-- For JAR plugins ver# 2.0.1 and previous ONLY!!!! -->
                    </archive>
                    <resource>
                        <directory>blobFilesFolder</directory>
                        <!-- it's not a good idea to filter binary files -->
                        <filtering>false</filtering>
                    </resource>


                    <!-- If you want to filter these deployment descriptors, then ...
                        these <containerConfigXML> and <webXml> tags WILL BE COMPLETELY OVERWRITTEN.
                        Filtered <resource> tags (see example below) are executed AFTER these tags.
                    -->
                    <!-- Only the last containerConfigXML element is effective -->
                    <containerConfigXML>META-INF/${project.groupId}-${project.artifactId}/weblogic.xml</containerConfigXML>
                    <containerConfigXML>src/main/webapp/META-INF/sun-ejb.xml</containerConfigXML>
                    <ejbXml>src/main/webapp/META-INF/${project.groupId}-${project.artifactId}/ejb.xml</ejbXml>
                    <ejbXml>src/main/webapp/META-INF/ejb.xml</ejbXml>
                </configuration>
            </plugin>

            <!-- https://central.sonatype.org/pages/apache-maven.html -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <sourcepath>src/main/java</sourcepath>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- The Maven GPG plugin is used to sign the components with the following configuration.
             * See https://blog.sonatype.com/2010/01/how-to-generate-pgp-signatures-with-maven/
             *      $ mvn clean deploy -Dgpg.keyname=D99F0F81840303DE293F4796067DA2CF1C7ADC98  -Dgpg.passphrase='Top-Scret$Pass#Phrase'
            -->
            <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>

            <!-- Performing a Release Deployment with the Maven Release Plugin -->
            <!-- https://central.sonatype.org/pages/apache-maven.html#performing-a-release-deployment-with-the-maven-release-plugin -->
            <!-- you can perform a release deployment to OSSRH with
                    mvn release:clean release:prepare
                by answering the prompts for versions and tags, followed by
                    mvn release:perform
                This execution will deploy to OSSRH and release to the Central Repository in one go, thanks to the usage of the Nexus Staging Maven Plugin with autoReleaseAfterClose set to true.
                -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>release</releaseProfiles>
                    <goals>deploy</goals>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.8</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>

        </plugins>

		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-resources-plugin</artifactId>
					<version>3.0.2</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>2.22.1</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.8.0</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>3.0.1</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>3.1.0</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-gpg-plugin</artifactId>
					<version>1.6</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>2.8.2</version>
				</plugin>
				<plugin>
					<groupId>org.nuiton</groupId>
					<artifactId>helper-maven-plugin</artifactId>
					<version>2.3.2</version>
				</plugin>
			</plugins>
		</pluginManagement>

	</build>

	<profiles>
		<profile>
			<id>release-sign-artifacts</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.nuiton</groupId>
						<artifactId>helper-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>get-pgp-passphrase</id>
								<goals>
									<goal>share-server-secret</goal>
								</goals>
								<phase>verify</phase>
								<configuration>
									<serverId>${gpg.serverId}</serverId>
									<usernameOut>${gpg.keyname}</usernameOut>
									<passwordOut>${gpg.passphrase}</passwordOut>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-gpg-plugin</artifactId>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

</project>
