<!--

    Copyright © 2022 Pl4yingNight (pl4yingnight@gmail.com)

    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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>net.runeduniverse.tools.build-helper</groupId>
	<artifactId>build-helper-generic</artifactId>
	<packaging>pom</packaging>
	<version>2</version>

	<name>Build Helper</name>
	<description>contains dependency management for build/install/deploy of maven projects</description>
	<url>https://github.com/RunedUniverse/build-helper</url>
	<inceptionYear>2021</inceptionYear>

	<modules>
		<module>../maven-java</module>
	</modules>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<!-- ACTIVITIONS -->
		<license-enforce>false</license-enforce>
		<!-- VERSIONS -->
		<plugin-maven-help-version>3.2.0</plugin-maven-help-version>
		<plugin-maven-clean-version>3.1.0</plugin-maven-clean-version>
		<plugin-maven-toolchains-version>3.1.0</plugin-maven-toolchains-version>
		<plugin-maven-resources-version>3.2.0</plugin-maven-resources-version>
		<plugin-maven-install-version>3.0.0-M1</plugin-maven-install-version>
		<plugin-mycila-license-version>4.2.rc1</plugin-mycila-license-version>
		<plugin-maven-gpg-version>3.0.1</plugin-maven-gpg-version>
		<plugin-mojohaus-build-helper-version>3.2.0</plugin-mojohaus-build-helper-version>
		<plugin-maven-deploy-version>3.0.0-M2</plugin-maven-deploy-version>
		<!-- TRACING -->
		<tracing-log-path>target/trace</tracing-log-path>
		<tracing-stage>full</tracing-stage>
	</properties>
	<licenses>
		<license>
			<name>Apache License, Version 2</name>
			<url>https://www.apache.org/licenses/LICENSE-2.0</url>
		</license>
	</licenses>
	<organization>
		<name>RunedUniverse</name>
		<url>https://www.runeduniverse.net</url>
	</organization>
	<developers>
		<developer>
			<id>pl4yingnight</id>
			<name>Pl4yingNight</name>
			<email>pl4yingnight@gmail.com</email>
			<organization>RunedUniverse</organization>
			<organizationUrl>https://www.runeduniverse.net</organizationUrl>
			<timezone>Europe/Vienna</timezone>
			<roles>
				<role>Maintainer</role>
				<role>Developer</role>
			</roles>
		</developer>
	</developers>
	<scm>
		<url>https://github.com/RunedUniverse/build-helper</url>
		<connection>scm:git:git://github.com/RunedUniverse/build-helper.git</connection>
		<developerConnection>scm:git:git@github.com:RunedUniverse/build-helper.git</developerConnection>
	</scm>
	<issueManagement>
		<system>GitHub Issues</system>
		<url>https://github.com/RunedUniverse/build-helper/issues</url>
	</issueManagement>
	<profiles>
		<!-- REPOSITORIES -->
		<profile>
			<id>repo-releases</id>
			<repositories>
				<repository>
					<id>runeduniverse-releases</id>
					<url>https://nexus.runeduniverse.net/repository/maven-releases/</url>
				</repository>
			</repositories>
		</profile>
		<profile>
			<!-- dev-repo contains: build-helper-java & development builds -->
			<id>repo-development</id>
			<repositories>
				<repository>
					<id>runeduniverse-development</id>
					<url>https://nexus.runeduniverse.net/repository/maven-development/</url>
				</repository>
			</repositories>
		</profile>
		<profile>
			<id>repo-snapshots</id>
			<repositories>
				<repository>
					<id>runeduniverse-snapshots</id>
					<url>https://nexus.runeduniverse.net/repository/maven-snapshots/</url>
				</repository>
			</repositories>
		</profile>
		<profile>
			<id>repo-maven-central-snapshots</id>
			<repositories>
				<repository>
					<id>central-nexus</id>
					<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
				</repository>
			</repositories>
		</profile>
		<!-- DISTRIBUTION REPOSITORIES -->
		<profile>
			<id>dist-repo-releases</id>
			<distributionManagement>
				<repository>
					<id>runeduniverse-releases</id>
					<url>https://nexus.runeduniverse.net/repository/maven-releases/</url>
				</repository>
			</distributionManagement>
		</profile>
		<profile>
			<id>dist-repo-development</id>
			<distributionManagement>
				<repository>
					<id>runeduniverse-development</id>
					<url>https://nexus.runeduniverse.net/repository/maven-development/</url>
				</repository>
			</distributionManagement>
		</profile>
		<profile>
			<id>dist-repo-snapshots</id>
			<distributionManagement>
				<repository>
					<id>runeduniverse-snapshots</id>
					<url>https://nexus.runeduniverse.net/repository/maven-snapshots/</url>
				</repository>
			</distributionManagement>
		</profile>
		<profile>
			<id>dist-repo-maven-central</id>
			<distributionManagement>
				<repository>
					<id>central-nexus</id>
					<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
				</repository>
			</distributionManagement>
		</profile>
		<profile>
			<id>dist-repo-maven-central-snapshots</id>
			<distributionManagement>
				<snapshotRepository>
					<id>central-nexus</id>
					<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
				</snapshotRepository>
			</distributionManagement>
		</profile>
		<!-- LICENSES -->
		<profile>
			<id>license-check</id>
			<build>
				<defaultGoal>license:check</defaultGoal>
				<plugins>
					<plugin>
						<groupId>com.mycila</groupId>
						<artifactId>license-maven-plugin</artifactId>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>license-update</id>
			<build>
				<defaultGoal>license:format</defaultGoal>
				<plugins>
					<plugin>
						<groupId>com.mycila</groupId>
						<artifactId>license-maven-plugin</artifactId>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<!-- APPROVE - RunedUniverse Utils Packages -->
			<id>license-prj-utils-approve</id>
			<build>
				<pluginManagement>
					<plugins>
						<plugin>
							<groupId>com.mycila</groupId>
							<artifactId>license-maven-plugin</artifactId>
							<configuration>
								<dependencyPolicies>
									<dependencyPolicy>
										<type>ARTIFACT_PATTERN</type>
										<rule>APPROVE</rule>
										<value>net.runeduniverse.lib.utils</value>
									</dependencyPolicy>
								</dependencyPolicies>
							</configuration>
						</plugin>
					</plugins>
				</pluginManagement>
			</build>
		</profile>
		<profile>
			<!-- APPROVE - Apache 2 -->
			<id>license-apache2-approve</id>
			<build>
				<pluginManagement>
					<plugins>
						<plugin>
							<groupId>com.mycila</groupId>
							<artifactId>license-maven-plugin</artifactId>
							<configuration>
								<dependencyPolicies>
									<dependencyPolicy>
										<type>LICENSE_NAME</type>
										<rule>APPROVE</rule>
										<value>Apache License, Version 2</value>
									</dependencyPolicy>
									<dependencyPolicy>
										<type>LICENSE_NAME</type>
										<rule>APPROVE</rule>
										<value>The Apache Software License, Version 2.0</value>
									</dependencyPolicy>
									<dependencyPolicy>
										<type>LICENSE_URL</type>
										<rule>APPROVE</rule>
										<value>http://www.apache.org/licenses/LICENSE-2.0</value>
									</dependencyPolicy>
									<dependencyPolicy>
										<type>LICENSE_URL</type>
										<rule>APPROVE</rule>
										<value>https://www.apache.org/licenses/LICENSE-2.0</value>
									</dependencyPolicy>
									<dependencyPolicy>
										<type>LICENSE_URL</type>
										<rule>APPROVE</rule>
										<value>http://www.apache.org/licenses/LICENSE-2.0.txt</value>
									</dependencyPolicy>
									<dependencyPolicy>
										<type>LICENSE_URL</type>
										<rule>APPROVE</rule>
										<value>https://www.apache.org/licenses/LICENSE-2.0.txt</value>
									</dependencyPolicy>
								</dependencyPolicies>
							</configuration>
						</plugin>
					</plugins>
				</pluginManagement>
			</build>
		</profile>
		<!-- ACTIONS -->
		<profile>
			<id>install</id>
			<properties>
				<tracing-stage>install</tracing-stage>
			</properties>
			<build>
				<defaultGoal>
					org.apache.maven.plugins:maven-help-plugin:effective-pom
					org.apache.maven.plugins:maven-clean-plugin:clean
					org.apache.maven.plugins:maven-resources-plugin:resources
					org.apache.maven.plugins:maven-gpg-plugin:sign
					org.apache.maven.plugins:maven-install-plugin:install
				</defaultGoal>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-clean-plugin</artifactId>
						<executions>
							<execution>
								<id>jenkins</id>
								<inherited>true</inherited>
								<phase>initialize</phase>
								<goals>
									<goal>clean</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-resources-plugin</artifactId>
						<executions>
							<execution>
								<id>jenkins</id>
								<inherited>true</inherited>
								<phase>process-resources</phase>
								<goals>
									<goal>resources</goal>
								</goals>
							</execution>
							<execution>
								<id>jenkins-testing</id>
								<inherited>true</inherited>
								<phase>process-test-resources</phase>
								<goals>
									<goal>testResources</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<executions>
							<execution>
								<id>jenkins</id>
								<inherited>true</inherited>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-install-plugin</artifactId>
						<executions>
							<execution>
								<id>jenkins</id>
								<inherited>true</inherited>
								<phase>install</phase>
								<goals>
									<goal>install</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-help-plugin</artifactId>
						<executions>
							<execution>
								<phase>install</phase>
								<goals>
									<goal>active-profiles</goal>
									<goal>all-profiles</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>deploy</id>
			<properties>
				<tracing-stage>deploy</tracing-stage>
			</properties>
			<build>
				<defaultGoal>
					org.apache.maven.plugins:maven-help-plugin:effective-pom
					org.apache.maven.plugins:maven-deploy-plugin:deploy
				</defaultGoal>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-deploy-plugin</artifactId>
						<executions>
							<execution>
								<id>jenkins</id>
								<inherited>true</inherited>
								<phase>deploy</phase>
								<goals>
									<goal>deploy</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-help-plugin</artifactId>
						<executions>
							<execution>
								<phase>deploy</phase>
								<goals>
									<goal>all-profiles</goal>
									<goal>active-profiles</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>deploy-signed</id>
			<properties>
				<tracing-stage>deploy-signed</tracing-stage>
			</properties>
			<build>
				<defaultGoal>
					org.apache.maven.plugins:maven-help-plugin:effective-pom
					org.codehaus.mojo:build-helper-maven-plugin:attach-artifact
					org.apache.maven.plugins:maven-deploy-plugin:deploy
				</defaultGoal>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>build-helper-maven-plugin</artifactId>
						<configuration>
							<artifacts>
								<!-- gpg signature -->
								<artifact>
									<file>${project.build.directory}/${project.build.finalName}.pom.asc</file>
									<type>pom.asc</type>
								</artifact>
							</artifacts>
						</configuration>
						<executions>
							<execution>
								<id>jenkins</id>
								<inherited>true</inherited>
								<phase>verify</phase>
								<goals>
									<goal>attach-artifact</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-deploy-plugin</artifactId>
						<executions>
							<execution>
								<id>jenkins</id>
								<inherited>true</inherited>
								<phase>deploy</phase>
								<goals>
									<goal>deploy</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-help-plugin</artifactId>
						<executions>
							<execution>
								<phase>deploy</phase>
								<goals>
									<goal>all-profiles</goal>
									<goal>active-profiles</goal>
								</goals>
							</execution>
							<execution>
								<id>jenkins-tracing</id>
								<inherited>true</inherited>
								<configuration>
									<artifact>${project.groupId}:${project.artifactId}</artifact>
									<output>${tracing-log-path}/${project.artifactId}#${tracing-stage}-eff-pom.xml</output>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>deploy-pom-signed</id>
			<properties>
				<tracing-stage>deploy-pom-signed</tracing-stage>
			</properties>
			<build>
				<defaultGoal>
					org.apache.maven.plugins:maven-help-plugin:effective-pom
					org.codehaus.mojo:build-helper-maven-plugin:attach-artifact
					org.apache.maven.plugins:maven-deploy-plugin:deploy
				</defaultGoal>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>build-helper-maven-plugin</artifactId>
						<configuration>
							<artifacts>
								<!-- gpg signature -->
								<artifact>
									<file>${project.build.directory}/${project.build.finalName}.pom.asc</file>
									<type>pom.asc</type>
								</artifact>
							</artifacts>
						</configuration>
						<executions>
							<execution>
								<id>jenkins</id>
								<inherited>true</inherited>
								<phase>verify</phase>
								<goals>
									<goal>attach-artifact</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-deploy-plugin</artifactId>
						<executions>
							<execution>
								<id>jenkins</id>
								<inherited>true</inherited>
								<phase>deploy</phase>
								<goals>
									<goal>deploy</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-help-plugin</artifactId>
						<executions>
							<execution>
								<phase>deploy</phase>
								<goals>
									<goal>all-profiles</goal>
									<goal>active-profiles</goal>
								</goals>
							</execution>
							<execution>
								<id>jenkins-tracing</id>
								<inherited>true</inherited>
								<configuration>
									<artifact>${project.groupId}:${project.artifactId}</artifact>
									<output>${tracing-log-path}/${project.artifactId}#${tracing-stage}-eff-pom.xml</output>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>gen-eff-pom</id>
			<build>
				<defaultGoal>
					org.apache.maven.plugins:maven-help-plugin:effective-pom
				</defaultGoal>
			</build>
		</profile>
		<!-- HELPER - PROFILES -->
		<profile>
			<id>helper-properties</id>
			<properties>
				<root-dir>${project.basedir}</root-dir>
			</properties>
		</profile>
		<profile>
			<id>helper-license</id>
			<build>
				<defaultGoal>license:format</defaultGoal>
				<plugins>
					<plugin>
						<groupId>com.mycila</groupId>
						<artifactId>license-maven-plugin</artifactId>
						<configuration>
							<properties>
								<year>2022</year>
								<owner>Pl4yingNight</owner>
								<email>pl4yingnight@gmail.com</email>
							</properties>
							<licenseSets>
								<licenseSet>
									<header>${root-dir}/src/license/header.txt</header>
								</licenseSet>
							</licenseSets>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-help-plugin</artifactId>
					<version>${plugin-maven-help-version}</version>
					<executions>
						<execution>
							<phase>none</phase>
						</execution>
						<execution>
							<id>jenkins</id>
							<inherited>true</inherited>
							<phase>none</phase>
						</execution>
						<execution>
							<id>jenkins-tracing</id>
							<inherited>true</inherited>
							<configuration>
								<artifact>${project.groupId}:${project.artifactId}</artifact>
								<output>${tracing-log-path}/${project.artifactId}#${tracing-stage}-eff-pom.xml</output>
							</configuration>
						</execution>
					</executions>
					<configuration>
						<output>${tracing-log-path}/${tracing-stage}-eff-pom.xml</output>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-clean-plugin</artifactId>
					<version>${plugin-maven-clean-version}</version>
					<executions>
						<execution>
							<id>jenkins</id>
							<inherited>true</inherited>
							<phase>none</phase>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-toolchains-plugin</artifactId>
					<version>${plugin-maven-toolchains-version}</version>
					<executions>
						<execution>
							<id>jenkins</id>
							<inherited>true</inherited>
							<phase>none</phase>
						</execution>
						<execution>
							<id>jenkins-testing</id>
							<inherited>true</inherited>
							<phase>none</phase>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-resources-plugin</artifactId>
					<version>${plugin-maven-resources-version}</version>
					<executions>
						<execution>
							<id>jenkins</id>
							<inherited>true</inherited>
							<phase>none</phase>
						</execution>
						<execution>
							<id>jenkins-testing</id>
							<inherited>true</inherited>
							<phase>none</phase>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-install-plugin</artifactId>
					<version>${plugin-maven-install-version}</version>
					<executions>
						<execution>
							<id>jenkins</id>
							<inherited>true</inherited>
							<phase>none</phase>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>com.mycila</groupId>
					<artifactId>license-maven-plugin</artifactId>
					<version>${plugin-mycila-license-version}</version>
					<executions>
						<execution>
							<id>jenkins</id>
							<inherited>true</inherited>
							<phase>none</phase>
						</execution>
					</executions>
					<configuration>
						<mapping>
							<java>SLASHSTAR_STYLE</java>
						</mapping>
						<licenseSets>
							<licenseSet>
								<!-- <header/> to be overwritten -->
								<excludes>
									<exclude>**/license/**</exclude>
								</excludes>
							</licenseSet>
						</licenseSets>
						<dependencyEnforce>${license-enforce}</dependencyEnforce>
						<dependencyExceptionMessage>1 or more dependencies got rejected
							doe to invalid licenses!
							Contact the Maintainer for a solution!</dependencyExceptionMessage>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-gpg-plugin</artifactId>
					<version>${plugin-maven-gpg-version}</version>
					<executions>
						<execution>
							<id>jenkins</id>
							<inherited>true</inherited>
							<!-- configuration = preconfigured -->
							<phase>none</phase>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>build-helper-maven-plugin</artifactId>
					<version>${plugin-mojohaus-build-helper-version}</version>
					<executions>
						<execution>
							<id>jenkins</id>
							<inherited>true</inherited>
							<phase>none</phase>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>${plugin-maven-deploy-version}</version>
					<executions>
						<execution>
							<id>jenkins</id>
							<inherited>true</inherited>
							<phase>none</phase>
						</execution>
					</executions>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
</project>