<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>ch.galinet</groupId>
	<artifactId>reproducible-build-maven-plugin</artifactId>
	<version>0.17.0</version>
	<packaging>maven-plugin</packaging>

	<name>Reproducible Build Maven Plugin</name>
	<description>This Plug-In allows to generate byte-for-byte reproducible artifacts</description>
	<url>https://github.com/nilsaellen/reproducible-build-maven-plugin/</url>

	<inceptionYear>2015</inceptionYear>
	<licenses>
		<license>
			<name>Apache 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<developers>
		<developer>
			<name>Thomas Lorblanchès</name>
			<email>zlika_ese@hotmail.com</email>
		</developer>
		<developer>
			<name>Nils Aellen</name>
			<email>nils@aellen.org</email>
		</developer>
	</developers>

	<scm>
		<connection>scm:git:git@github.com:nilsaellen/reproducible-build-maven-plugin.git</connection>
		<developerConnection>scm:git:git@github.com:nilsaellen/reproducible-build-maven-plugin.git</developerConnection>
		<url>https://github.com/nilsaellen/reproducible-build-maven-plugin/</url>
		<tag>ossrh-deploy</tag>
	</scm>

	<distributionManagement>
		<snapshotRepository>
			<id>ossrh</id>
			<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
	</distributionManagement>

	<properties>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.build.outputTimestamp>1725638923</project.build.outputTimestamp>

		<!-- Maven plugin versions -->
		<apache-source-release-assembly-descriptor.version>1.0.6</apache-source-release-assembly-descriptor.version>
		<checkstyle.version>9.0.1</checkstyle.version>
		<coveralls-maven-plugin.version>4.4.1</coveralls-maven-plugin.version>
		<spotbugs-maven-plugin.version>4.7.2.1</spotbugs-maven-plugin.version>
		<jacoco-maven-plugin.version>0.8.8</jacoco-maven-plugin.version>
		<maven-assembly-plugin.version>3.4.2</maven-assembly-plugin.version>
		<maven-checkstyle-plugin.version>3.2.0</maven-checkstyle-plugin.version>
		<maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
		<maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
		<maven-deploy-plugin.version>3.0.0</maven-deploy-plugin.version>
		<maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
		<maven-install-plugin.version>3.0.1</maven-install-plugin.version>
		<maven-invoker-plugin.version>3.3.0</maven-invoker-plugin.version>
		<maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
		<maven-javadoc-plugin.version>3.4.1</maven-javadoc-plugin.version>
		<maven-plugin-plugin.version>3.6.4</maven-plugin-plugin.version>
		<maven-project-info-reports-plugin.version>3.4.1</maven-project-info-reports-plugin.version>
		<maven-release-plugin.version>3.0.0-M6</maven-release-plugin.version>
		<maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
		<maven-scm.version>2.0.0-M2</maven-scm.version>
		<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
		<maven-site-plugin.version>4.0.0-M3</maven-site-plugin.version>
		<maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
		<maven-surefire-report-plugin.version>3.0.0-M7</maven-surefire-report-plugin.version>
		<wagon-gitsite.version>0.3.1</wagon-gitsite.version>

		<!-- Dependency versions -->
		<commons-compress.version>1.26.0</commons-compress.version>
		<commons-codec.version>1.16.1</commons-codec.version>
    <junit.version>4.13.2</junit.version>
		<maven-plugin-annotations.version>3.6.0</maven-plugin-annotations.version>
		<maven-plugin-api.version>3.6.0</maven-plugin-api.version>
		<plexus-utils.version>3.4.2</plexus-utils.version>

	</properties>

	<dependencies>

		<dependency>
			<groupId>org.apache.maven</groupId>
			<artifactId>maven-plugin-api</artifactId>
			<version>${maven-plugin-api.version}</version>
		<scope>provided</scope>
    </dependency>

		<dependency>
			<groupId>org.apache.maven.plugin-tools</groupId>
			<artifactId>maven-plugin-annotations</artifactId>
			<version>${maven-plugin-annotations.version}</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>org.codehaus.plexus</groupId>
			<artifactId>plexus-utils</artifactId>
			<version>${plexus-utils.version}</version>
		</dependency>

		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-compress</artifactId>
			<version>${commons-compress.version}</version>
			<exclusions>
				<exclusion>
					<groupId>com.github.luben</groupId>
					<artifactId>zstd-jni</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.brotli</groupId>
					<artifactId>dec</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.tukaani</groupId>
					<artifactId>xz</artifactId>
				</exclusion>
			</exclusions></dependency>

    <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
      <version>${commons-codec.version}</version>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>${junit.version}</version>
			<scope>test</scope>
		</dependency>

	</dependencies>

	<build>

		<!-- Extensions to deploy site documentation to Github using Github's pages system.
				 Cf. http://khuxtable.github.io/wagon-gitsite/ -->
		<extensions>
			<extension>
				<groupId>org.apache.maven.scm</groupId>
				<artifactId>maven-scm-provider-gitexe</artifactId>
				<version>${maven-scm.version}</version>
			</extension>
			<extension>
				<groupId>org.apache.maven.scm</groupId>
				<artifactId>maven-scm-manager-plexus</artifactId>
				<version>${maven-scm.version}</version>
			</extension>
			<extension>
				<groupId>org.kathrynhuxtable.maven.wagon</groupId>
				<artifactId>wagon-gitsite</artifactId>
				<version>${wagon-gitsite.version}</version>
			</extension>
		</extensions>

		<pluginManagement>
			<plugins>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-clean-plugin</artifactId>
					<version>${maven-clean-plugin.version}</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-resources-plugin</artifactId>
					<version>${maven-resources-plugin.version}</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>${maven-compiler-plugin.version}</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>${maven-surefire-plugin.version}</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<version>${maven-jar-plugin.version}</version>
					<configuration>
						<archive>
							<manifestEntries>
								<Automatic-Module-Name>${project.groupId}.reproducible</Automatic-Module-Name>
							</manifestEntries>
						</archive>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-release-plugin</artifactId>
					<version>${maven-release-plugin.version}</version>
					<configuration>
						<autoVersionSubmodules>true</autoVersionSubmodules>
						<useReleaseProfile>false</useReleaseProfile>
						<releaseProfiles>release</releaseProfiles>
						<goals>deploy site-deploy</goals>
						<tagNameFormat>v@{project.version}</tagNameFormat>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-install-plugin</artifactId>
					<version>${maven-install-plugin.version}</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>${maven-deploy-plugin.version}</version>
				</plugin>

				<plugin>
					<groupId>org.jacoco</groupId>
					<artifactId>jacoco-maven-plugin</artifactId>
					<version>${jacoco-maven-plugin.version}</version>
					<configuration>
						<excludes>
							<exclude>**/*HelpMojo.*</exclude>
						</excludes>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-site-plugin</artifactId>
					<version>${maven-site-plugin.version}</version>
				</plugin>

				<plugin>
					<groupId>io.jsonwebtoken.coveralls</groupId>
					<artifactId>coveralls-maven-plugin</artifactId>
					<version>${coveralls-maven-plugin.version}</version>
					<configuration>
						<repoToken>${env.COVERALLS_API_KEY}</repoToken>
					</configuration>
				</plugin>

			</plugins>
		</pluginManagement>

		<plugins>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-plugin-plugin</artifactId>
				<version>${maven-plugin-plugin.version}</version>
				<configuration>
					<goalPrefix>reproducible-build</goalPrefix>
					<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
				</configuration>
				<executions>
					<execution>
						<id>mojo-descriptor</id>
						<goals>
							<goal>descriptor</goal>
						</goals>
					</execution>
					<execution>
						<id>help-goal</id>
						<goals>
							<goal>helpmojo</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-checkstyle-plugin</artifactId>
				<version>${maven-checkstyle-plugin.version}</version>
				<configuration>
					<propertyExpansion>config_loc=${project.basedir}</propertyExpansion>
					<configLocation>checkstyle.xml</configLocation>
					<suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
					<consoleOutput>true</consoleOutput>
					<failsOnError>true</failsOnError>
					<includeTestSourceDirectory>true</includeTestSourceDirectory>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>check</goal>
						</goals>
					</execution>
				</executions>
				<dependencies>
					<dependency>
						<groupId>com.puppycrawl.tools</groupId>
						<artifactId>checkstyle</artifactId>
						<version>${checkstyle.version}</version>
					</dependency>
				</dependencies>
			</plugin>

		</plugins>
	</build>

	<reporting>
		<plugins>

			<!-- Static code analysis report -->
			<plugin>
				<groupId>com.github.spotbugs</groupId>
				<artifactId>spotbugs-maven-plugin</artifactId>
				<version>${spotbugs-maven-plugin.version}</version>
				<configuration>
					<effort>max</effort>
					<threshold>Default</threshold>
				</configuration>
			</plugin>

			<!-- Unit tests report -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-report-plugin</artifactId>
				<version>${maven-surefire-report-plugin.version}</version>
			</plugin>

			<!-- Integration tests report -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-invoker-plugin</artifactId>
				<version>${maven-invoker-plugin.version}</version>
			</plugin>

			<!-- Plugin documentation report -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-plugin-plugin</artifactId>
				<version>${maven-plugin-plugin.version}</version>
				<configuration>
					<requirements>
						<jdk>${project.build.java.target}</jdk>
					</requirements>
				</configuration>
			</plugin>

			<!-- Project info report -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-project-info-reports-plugin</artifactId>
				<version>${maven-project-info-reports-plugin.version}</version>
			</plugin>

			<!-- Code coverage report -->
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>${jacoco-maven-plugin.version}</version>
				<configuration>
					<excludes>
						<exclude>**/*HelpMojo.*</exclude>
					</excludes>
				</configuration>
			</plugin>

		</plugins>
	</reporting>

	<profiles>

		<!-- Run the integration tests -->
		<profile>
			<id>run-its</id>
			<build>
				<plugins>

					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-invoker-plugin</artifactId>
						<version>${maven-invoker-plugin.version}</version>
						<configuration>
							<debug>true</debug>
							<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
							<pomIncludes>
								<pomInclude>*/pom.xml</pomInclude>
							</pomIncludes>
							<postBuildHookScript>verify</postBuildHookScript>
							<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
							<settingsFile>src/it/settings.xml</settingsFile>
							<goals>
								<goal>clean</goal>
								<goal>test-compile</goal>
							</goals>
						</configuration>
						<executions>
							<execution>
								<id>integration-test</id>
								<goals>
									<goal>install</goal>
									<goal>integration-test</goal>
									<goal>verify</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

					<plugin>
						<groupId>org.jacoco</groupId>
						<artifactId>jacoco-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>jacoco-prepare-agent-unit-test</id>
								<goals>
									<goal>prepare-agent</goal>
								</goals>
								<configuration>
									<destFile>${project.build.directory}/jacoco/jacoco-ut.exec</destFile>
								</configuration>
							</execution>
							<execution>
								<id>jacoco-prepare-agent-integration-test</id>
								<phase>pre-integration-test</phase>
								<goals>
									<goal>prepare-agent</goal>
								</goals>
								<configuration>
									<destFile>${project.build.directory}/jacoco/jacoco-it.exec</destFile>
									<propertyName>invoker.mavenOpts</propertyName>
								</configuration>
							</execution>
							<execution>
								<id>jacoco-merge</id>
								<phase>post-integration-test</phase>
								<goals>
									<goal>merge</goal>
								</goals>
								<configuration>
									<fileSets>
										<fileSet>
											<directory>${project.build.directory}/jacoco</directory>
											<includes>
												<include>*.exec</include>
											</includes>
										</fileSet>
									</fileSets>
								</configuration>
							</execution>
						</executions>
					</plugin>

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

		<!-- Additional goals to release the plugin -->
		<profile>
			<id>sonatype-oss-release</id>
			<build>
				<plugins>

					<!-- Generate source attachment -->
					<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>

					<!-- Generate javadoc attachment -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<version>${maven-javadoc-plugin.version}</version>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

					<!-- Create a source-release artifact that contains the fully buildable
							 project directory source structure -->
					<!--<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-assembly-plugin</artifactId>
						<version>${maven-assembly-plugin.version}</version>
						<dependencies>
							<dependency>
								<groupId>org.apache.apache.resources</groupId>
								<artifactId>apache-source-release-assembly-descriptor</artifactId>
								<version>${apache-source-release-assembly-descriptor.version}</version>
							</dependency>
						</dependencies>
						<executions>
							<execution>
								<id>source-release-assembly</id>
								<phase>package</phase>
								<goals>
									<goal>single</goal>
								</goals>
								<configuration>
									<runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
									<descriptorRefs>
										<descriptorRef>source-release</descriptorRef>
									</descriptorRefs>
									<tarLongFileMode>posix</tarLongFileMode>
								</configuration>
							</execution>
						</executions>
					</plugin>-->

					<!-- Sign the artifacts -->
					<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>
									<homedir>${session.executionRootDirectory}</homedir>
									<keyname>eb11bc74</keyname>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
						<version>1.6.7</version>
						<extensions>true</extensions>
						<configuration>
							<serverId>ossrh</serverId>
							<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
							<autoReleaseAfterClose>true</autoReleaseAfterClose>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
