<?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/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>org.sentrysoftware.maven</groupId>
	<artifactId>sentry-maven-skin</artifactId>
	<version>6.2.00</version>
	<packaging>jar</packaging>

	<name>Sentry Maven Skin</name>
	<description>
		The Sentry Maven Skin is a Maven skin for Maven-generated sites.
		It is based on the excellent Maven Reflow Skin developed by Andrius Velykis (http://andriusvelykis.github.io/reflow-maven-skin/).
		However, because Reflow is no longer maintained, we had to fork the projet and go with our own!
	</description>
	<inceptionYear>2017</inceptionYear>
	<url>https://sentrysoftware.github.io/sentry-maven-skin</url>

	<organization>
		<name>Sentry Software</name>
		<url>https://sentrysoftware.com</url>
	</organization>

	<distributionManagement>
		<snapshotRepository>
			<id>ossrh</id>
			<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
		<repository>
			<id>ossrh</id>
			<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
	</distributionManagement>

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

	<issueManagement>
		<system>GitHub</system>
		<url>https://github.com/sentrysoftware/sentry-maven-skin/issues/</url>
	</issueManagement>

	<scm>
		<connection>scm:git:https://github.com/sentrysoftware/sentry-maven-skin.git</connection>
		<url>https://github.com/sentrysoftware/sentry-maven-skin</url>
		<tag>v6.2.00</tag>
	</scm>

	<developers>
		<developer>
			<name>Bertrand Martin (@bertysentry)</name>
			<email>bertrand@sentrysoftware.com</email>
			<roles>
				<role>Project founder</role>
			</roles>
		</developer>
	</developers>

	<properties>

		<!-- UTF-8 -->
		<project.build.encoding>UTF-8</project.build.encoding>
		<project.build.sourceEncoding>${project.build.encoding}</project.build.sourceEncoding>
		<project.build.resourceEncoding>${project.build.encoding}</project.build.resourceEncoding>

		<!-- Reproducible Build -->
		<!-- See https://maven.apache.org/guides/mini/guide-reproducible-builds.html -->
		<project.build.outputTimestamp>2023-11-19T19:02:48Z</project.build.outputTimestamp>

		<!-- How to execute the Node.js section -->
		<!-- On GitHub Actions, we will use the exec-maven-plugin -->
		<!-- On local dev PC, we will use the frontend-maven-plugin -->
		<skipFrontendPlugin>false</skipFrontendPlugin>
		<skipExecPlugin>true</skipExecPlugin>

	</properties>

	<build>

		<sourceDirectory>${project.basedir}/src/main/webapp</sourceDirectory>

		<!-- Actual build plugins -->
		<plugins>

			<!-- license -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>license-maven-plugin</artifactId>
				<version>2.3.0</version>
				<configuration>
					<licenseName>apache_v2</licenseName>
					<copyrightOwners>Sentry Software</copyrightOwners>
					<copyrightStringFormat>Copyright %1$s %2$s</copyrightStringFormat>
					<includes>
						<include>main/webapp/**/*.vm</include>
						<include>main/webapp/**/*.js</include>
					</includes>
					<trimHeaderLine>true</trimHeaderLine>
					<canUpdateCopyright>true</canUpdateCopyright>
					<canUpdateDescription>true</canUpdateDescription>
					<processStartTag>╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲</processStartTag>
					<sectionDelimiter>჻჻჻჻჻჻</sectionDelimiter>
					<processEndTag>╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱</processEndTag>
				</configuration>
				<executions>
					<execution>
						<id>check-license</id>
						<phase>process-sources</phase>
						<goals>
							<goal>check-file-header</goal>
						</goals>
						<configuration>
							<failOnMissingHeader>true</failOnMissingHeader>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<!-- site -->
			<plugin>
				<artifactId>maven-site-plugin</artifactId>
				<version>3.12.1</version>
				<dependencies>
					<dependency>
						<groupId>org.sentrysoftware.maven</groupId>
						<artifactId>maven-skin-tools</artifactId>
						<version>1.2.00</version>
					</dependency>
				</dependencies>
			</plugin>

			<!-- frontend -->
			<plugin>
				<groupId>com.github.eirslett</groupId>
				<artifactId>frontend-maven-plugin</artifactId>
				<version>1.14.2</version>
				<executions>

					<!-- initialize -->
					<!-- Install Node.js -->
					<execution>
						<id>install-nodejs</id>
						<phase>initialize</phase>
						<goals>
							<goal>install-node-and-npm</goal>
						</goals>
						<!-- optional: default phase is "generate-resources" -->
						<configuration>
							<nodeVersion>v20.9.0</nodeVersion>
						</configuration>
					</execution>

					<!-- generate-resources -->
					<!-- Run "npm ci" -->
					<execution>
						<id>npm-install</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>npm</goal>
						</goals>
						<configuration>
							<arguments>ci</arguments>
						</configuration>
					</execution>

					<!-- prepare-package -->
					<!-- Run "gulp" -->
					<execution>
						<id>gulp</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>gulp</goal>
						</goals>
					</execution>

				</executions>
				<configuration>
					<workingDirectory>${project.basedir}</workingDirectory>
					<skip>${skipFrontendPlugin}</skip>
				</configuration>
			</plugin>

			<!-- exec -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>exec-maven-plugin</artifactId>
				<version>3.1.1</version>
				<executions>

					<!-- generate-resources -->
					<!-- Run "npm ci" -->
					<execution>
						<id>exec-npm-ci</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>exec</goal>
						</goals>
						<configuration>
							<executable>npm</executable>
							<arguments>
								<argument>ci</argument>
							</arguments>
						</configuration>
					</execution>

					<!-- prepare-package -->
					<!-- Run "gulp" -->
					<execution>
						<id>gulp</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>exec</goal>
						</goals>
						<configuration>
							<executable>gulp</executable>
						</configuration>
					</execution>

				</executions>
				<configuration>
					<skip>${skipExecPlugin}</skip>
				</configuration>

			</plugin>

			<!-- source -->
			<plugin>
				<artifactId>maven-source-plugin</artifactId>
				<version>3.3.0</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<!-- assembly -->
			<!-- build a fake javadoc JAR to workaround Maven Central rules -->
			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>3.6.0</version>
				<executions>

					<execution>
						<id>javadoc</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
							<descriptors>
								<descriptor>assembly-javadoc.xml</descriptor>
							</descriptors>
							<attach>true</attach>
						</configuration>
					</execution>

				</executions>
			</plugin>

			<!-- jar -->
			<plugin>
				<artifactId>maven-jar-plugin</artifactId>
				<version>3.3.0</version>
				<configuration>
					<classesDirectory>${project.build.directory}/dist</classesDirectory>
				</configuration>
			</plugin>

			<!--  maven-invoker-plugin -->
			<plugin>
				<artifactId>maven-invoker-plugin</artifactId>
				<version>3.6.0</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>
					<extraArtifacts>
						<!-- <extraArtifact>org.sentrysoftware.maven.maven-skin-tools:1.0.00</extraArtifact> -->
					</extraArtifacts>
					<settingsFile>src/it/settings.xml</settingsFile>
					<goals>
						<goal>clean</goal>
						<goal>site</goal>
					</goals>
				</configuration>
				<executions>
					<execution>
						<id>integration-test</id>
						<goals>
							<goal>install</goal>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<!-- deploy -->
			<plugin>
				<artifactId>maven-deploy-plugin</artifactId>
				<version>3.1.1</version>
			</plugin>

		</plugins>
	</build>

	<reporting>
		<plugins>

			<!-- jxr: creates XRef links -->
			<plugin>
				<artifactId>maven-jxr-plugin</artifactId>
				<version>3.3.1</version>
			</plugin>

			<!-- changelog -->
			<plugin>
				<artifactId>maven-changelog-plugin</artifactId>
				<version>2.3</version>
			</plugin>

			<!-- invoker -->
			<plugin>
				<artifactId>maven-invoker-plugin</artifactId>
				<version>3.6.0</version>
			</plugin>

			<!-- Default project-info-reports -->
			<plugin>
				<artifactId>maven-project-info-reports-plugin</artifactId>
				<version>3.4.5</version>
				<reportSets>
					<reportSet>
						<reports>
							<report>ci-management</report>
							<report>dependencies</report>
							<report>dependency-info</report>
							<report>distribution-management</report>
							<report>issue-management</report>
							<report>licenses</report>
							<report>plugins</report>
							<report>scm</report>
							<report>summary</report>
							<report>team</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>

		</plugins>
	</reporting>

	<profiles>

		<!-- Profile for CI (GitHub Actions) -->
		<!-- We will execute Node.js stuff directly, as we're guaranteed a proper environment -->
		<!-- This is much faster than installing Node.js with the frontend Maven plugin -->
		<profile>
			<id>CI</id>
			<activation>
				<property>
					<name>env.CI</name>
				</property>
			</activation>
			<properties>
				<skipFrontendPlugin>true</skipFrontendPlugin>
				<skipExecPlugin>false</skipExecPlugin>
			</properties>
		</profile>

		<!-- Profile for releasing the project -->
		<profile>
			<id>release</id>
			<build>
				<plugins>

					<!-- artifact (Reproducible Build) -->
					<plugin>
						<artifactId>maven-artifact-plugin</artifactId>
						<version>3.5.0</version>
						<executions>
							<execution>
								<id>buildinfo</id>
								<phase>verify</phase>
								<goals>
									<goal>buildinfo</goal>
								</goals>
								<configuration>
									<reproducible>true</reproducible>
								</configuration>
							</execution>
						</executions>
					</plugin>

					<!-- gpg to sign the released artifacts -->
					<plugin>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>3.1.0</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
								<configuration>
									<updateReleaseInfo>true</updateReleaseInfo>
									<gpgArguments>
										<arg>--pinentry-mode</arg>
										<arg>loopback</arg>
									</gpgArguments>
								</configuration>
							</execution>
						</executions>
					</plugin>

					<!-- nexus-staging (Sonatype) -->
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
						<version>1.6.13</version>
						<extensions>true</extensions>
						<configuration>
							<serverId>ossrh</serverId>
							<nexusUrl>https://s01.oss.sonatype.org</nexusUrl>
							<autoReleaseAfterClose>${env.AUTO_RELEASE_AFTER_CLOSE}</autoReleaseAfterClose>
						</configuration>
					</plugin>

					<!-- release -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-release-plugin</artifactId>
						<version>3.0.1</version>
						<configuration>
							<tagNameFormat>v@{project.version}</tagNameFormat>
						</configuration>
						<executions>
							<execution>
								<id>default</id>
								<goals>
									<goal>perform</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

</project>