<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.mosip.esignet</groupId>
	<artifactId>apitest-esignet</artifactId>
	<packaging>jar</packaging>
	<name>apitest-esignet</name>
	<description>Parent project of MOSIP Esignet apitests</description>
	<url>https://github.com/mosip/esignet</url>
	<version>1.6.1</version>

	<licenses>
		<license>
			<name>MPL 2.0</name>
			<url>https://www.mozilla.org/en-US/MPL/2.0/</url>
		</license>
	</licenses>

	<scm>
		<connection>scm:git:git://github.com/mosip/esignet.git</connection>
		<developerConnection>scm:git:ssh://github.com:mosip/esignet.git</developerConnection>
		<url>https://github.com/mosip/esignet</url>
		<tag>HEAD</tag>
	</scm>

	<developers>
		<developer>
			<name>Mosip</name>
			<email>mosip.emailnotifier@gmail.com</email>
			<organization>io.mosip</organization>
			<organizationUrl>https://github.com/mosip/esignet</organizationUrl>
		</developer>
	</developers>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

		<!-- maven -->
		<maven.compiler.target>21</maven.compiler.target>
		<maven.compiler.source>21</maven.compiler.source>
		<maven.compiler.version>3.8.0</maven.compiler.version>
		<maven.jar.plugin.version>3.0.2</maven.jar.plugin.version>
		<maven.war.plugin.version>3.1.0</maven.war.plugin.version>
		<maven.javadoc.version>3.2.0</maven.javadoc.version>
		<maven.gpg.plugin.version>1.5</maven.gpg.plugin.version>
		<maven.shade.plugin.version>3.2.4</maven.shade.plugin.version>
		<maven.antrun.plugin.version>3.0.0</maven.antrun.plugin.version>
		<maven.source.plugin.version>2.2.1</maven.source.plugin.version>
		<central.publishing.maven.plugin.version>0.7.0</central.publishing.maven.plugin.version>
		<git.commit.id.plugin.version>3.0.1</git.commit.id.plugin.version>
		<fileName>apitest-esignet-1.6.1-jar-with-dependencies</fileName>
	</properties>

	<dependencies>
		<dependency>
			<groupId>io.mosip.testrig.apitest.commons</groupId>
			<artifactId>apitest-commons</artifactId>
			<version>1.3.2</version>
		</dependency>
	</dependencies>
	<distributionManagement>
		<snapshotRepository>
			<id>ossrh</id>
			<url>https://central.sonatype.com/repository/maven-snapshots/</url>
		</snapshotRepository>
		<repository>
			<id>ossrh</id>
			<url>https://central.sonatype.com/api/v1/publisher</url>
		</repository>
	</distributionManagement>
	<build>
		<pluginManagement>
			<plugins>
			</plugins>
		</pluginManagement>

		<plugins>
			<plugin>
				<groupId>org.sonatype.central</groupId>
				<artifactId>central-publishing-maven-plugin</artifactId>
				<version>${central.publishing.maven.plugin.version}</version>
				<extensions>true</extensions>
				<configuration>
					<publishingServerId>ossrh</publishingServerId>
					<autoPublish>false</autoPublish>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<doclint>none</doclint>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>${maven.compiler.version}</version>
				<configuration>
					<source>${maven.compiler.source}</source>
					<target>${maven.compiler.target}</target>
					<argLine>-Dfile.encoding=UTF-8</argLine>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>${maven.javadoc.version}</version>
				<configuration>
					<doclint>none</doclint>
				</configuration>
			</plugin>
			<plugin>
				<groupId>pl.project13.maven</groupId>
				<artifactId>git-commit-id-plugin</artifactId>
				<version>${git.commit.id.plugin.version}</version>
				<executions>
					<execution>
						<id>populate-git-commit-information</id>
						<goals>
							<goal>revision</goal>
						</goals>
						<configuration>
							<verbose>true</verbose>
							<dateFormat>MM/dd/yyyy HH:mm:ss Z</dateFormat>
							<abbrevLength>8</abbrevLength>
							<generateGitPropertiesFile>true</generateGitPropertiesFile>
							<generateGitPropertiesFilename>
								${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
						</configuration>
					</execution>
				</executions>
				<configuration>
					<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-gpg-plugin</artifactId>
				<version>${maven.gpg.plugin.version}</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>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<version>${maven.shade.plugin.version}</version>
				<executions>
					<execution>
						<goals>
							<goal>shade</goal>
						</goals>
						<configuration>
							<finalName>${fileName}</finalName>
							<transformers>
								<!-- need this to merge the services files
								properly -->
								<transformer
									implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
								<!-- add Main-Class to manifest file -->
								<transformer
									implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
									<mainClass>
										io.mosip.testrig.apirig.esignet.testrunner.MosipTestRunner</mainClass>
								</transformer>
							</transformers>
							<!-- add this to prevent some security issues when
							merging everything together -->
							<filters>
								<filter>
									<artifact>*:*</artifact>
									<excludes>
										<exclude>META-INF/*.SF</exclude>
										<exclude>META-INF/*.DSA</exclude>
										<exclude>META-INF/*.RSA</exclude>
									</excludes>
								</filter>
							</filters>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>${maven.jar.plugin.version}</version>
				<configuration>
					<archive>
						<manifest>
							<addClasspath>true</addClasspath>
							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
						</manifest>
						<manifestEntries>
							<Project-Name>${project.name}</Project-Name>
							<Project-Version>${project.version}</Project-Version>
							<Built-By>${user.name}</Built-By>
							<Built-OS>${os.name}</Built-OS>
							<Local-Build-Date>${maven.build.timestamp}</Local-Build-Date>
							<Build-Number>${env.BUILD_NUMBER}</Build-Number>
							<Build-Date>${env.BUILD_ID}</Build-Date>
							<Build-URL>${env.BUILD_URL}</Build-URL>
						</manifestEntries>
					</archive>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<version>${maven.war.plugin.version}</version>
				<configuration>
					<archive>
						<manifest>
							<addClasspath>true</addClasspath>
							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
						</manifest>
						<manifestEntries>
							<Project-Name>${project.name}</Project-Name>
							<Project-Version>${project.version}</Project-Version>
							<Built-By>${user.name}</Built-By>
							<Built-OS>${os.name}</Built-OS>
							<Local-Build-Date>${maven.build.timestamp}</Local-Build-Date>
							<Build-Number>${env.BUILD_NUMBER}</Build-Number>
							<Build-Date>${env.BUILD_ID}</Build-Date>
							<Build-URL>${env.BUILD_URL}</Build-URL>
						</manifestEntries>
					</archive>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>${maven.source.plugin.version}</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-antrun-plugin</artifactId>
				<version>${maven.antrun.plugin.version}</version>
				<executions>
					<execution>
						<id>make-jar-executable</id>
						<phase>package</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<target>
								<!-- Create a shell script to run the JAR file
								with executable permission -->
								<chmod file="${project.build.directory}/*.jar"
									perm="ugo+rx" />
							</target>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
