<!--

    Copyright © 2023 VenaNocta (venanocta@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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>net.runeduniverse.tools.maven.r4m</groupId>
	<artifactId>r4m-parent</artifactId>
	<version>1.0.0</version>
	<packaging>pom</packaging>

	<name>Runes4Maven Parent</name>
	<description>Runes4Maven (r4m) Maven Extension provides an alternative way
		for defining maven executions and adds QoL improvements</description>
	<url>https://github.com/RunedUniverse/r4m-maven-extension</url>
	<inceptionYear>2022</inceptionYear>

	<modules>
		<module>sources</module>
		<module>api</module>
		<module>model</module>
		<module>model-builder</module>
		<module>extension</module>
	</modules>

	<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>venanocta</id>
			<name>VenaNocta</name>
			<email>venanocta@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/r4m-maven-extension</url>
		<connection>
			scm:git:http://github.com/RunedUniverse/r4m-maven-extension.git</connection>
		<developerConnection>
			scm:git:git@github.com:RunedUniverse/r4m-maven-extension.git</developerConnection>
	</scm>
	<issueManagement>
		<system>GitHub Issues</system>
		<url>https://github.com/RunedUniverse/r4m-maven-extension/issues</url>
	</issueManagement>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<java-source-version>1.8</java-source-version>
		<java-target-version>${java-source-version}</java-target-version>
		<root-dir>${basedir}</root-dir>
		<!-- VERSIONS -->
		<major-version>1</major-version>
		<minor-version>0</minor-version>
		<artifact-version>0</artifact-version>
		<!-- ARTIFACT VERSIONS -->
		<maven-version-min>3.3.9</maven-version-min>
		<!-- ARTIFACT VERSIONS - COMPILER -->
		<maven-plugin-plugin-version>3.6.4</maven-plugin-plugin-version>
		<plexus-component-version>1.7.1</plexus-component-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-compiler-version>3.8.0</plugin-maven-compiler-version>
		<plugin-maven-jar-version>3.0.2</plugin-maven-jar-version>
		<plugin-maven-source-version>3.2.1</plugin-maven-source-version>
		<plugin-maven-javadoc-version>3.2.0</plugin-maven-javadoc-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>
	</properties>

	<profiles>
		<profile>
			<id>dev-install</id>
			<build>
				<defaultGoal>clean license:format install</defaultGoal>
			</build>
		</profile>
		<!-- PIPELINE -->
		<profile>
			<id>install</id>
			<build>
				<defaultGoal>clean install</defaultGoal>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-toolchains-plugin</artifactId>
						<configuration>
							<toolchains>
								<jdk>
									<version>openjdk-1.8.0</version>
								</jdk>
							</toolchains>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<executions>
							<execution>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<executions>
							<execution>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<executions>
							<execution>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>deploy</id>
			<build>
				<defaultGoal>
					org.apache.maven.plugins:maven-jar-plugin:jar
					org.apache.maven.plugins:maven-deploy-plugin:deploy
				</defaultGoal>
			</build>
		</profile>
		<profile>
			<id>deploy-signed</id>
			<build>
				<defaultGoal>
					org.apache.maven.plugins:maven-jar-plugin:jar
					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>
						<executions>
							<execution>
								<goals>
									<goal>attach-artifact</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<artifacts>
								<!-- gpg signatures -->
								<artifact>
									<file>
										${project.build.directory}/${project.build.finalName}.pom.asc</file>
									<type>pom.asc</type>
								</artifact>
								<artifact>
									<file>
										${project.build.directory}/${project.build.finalName}.jar.asc</file>
									<type>jar.asc</type>
								</artifact>
								<!-- javadoc -->
								<artifact>
									<file>
										${project.build.directory}/${project.build.finalName}-javadoc.jar</file>
									<type>jar</type>
									<classifier>javadoc</classifier>
								</artifact>
								<artifact>
									<file>
										${project.build.directory}/${project.build.finalName}-javadoc.jar.asc</file>
									<type>jar.asc</type>
									<classifier>javadoc</classifier>
								</artifact>
								<!-- sources -->
								<artifact>
									<file>
										${project.build.directory}/${project.build.finalName}-sources.jar</file>
									<type>jar</type>
									<classifier>sources</classifier>
								</artifact>
								<artifact>
									<file>
										${project.build.directory}/${project.build.finalName}-sources.jar.asc</file>
									<type>jar.asc</type>
									<classifier>sources</classifier>
								</artifact>
							</artifacts>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>deploy-pom-signed</id>
			<build>
				<defaultGoal>
					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>
								<goals>
									<goal>attach-artifact</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<!-- 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>
		<!-- 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-maven-central</id>
			<distributionManagement>
				<repository>
					<id>central-nexus</id>
					<url>
						https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
				</repository>
			</distributionManagement>
		</profile>
		<!-- LICENSES -->
		<profile>
			<id>license-check</id>
			<build>
				<defaultGoal>license:check</defaultGoal>
				<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>
			</build>
		</profile>

	</profiles>

	<build>
		<resources>
			<resource>
				<directory>${basedir}</directory>
				<targetPath>META-INF</targetPath>
				<includes>
					<include>LICENSE</include>
				</includes>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-toolchains-plugin</artifactId>
				<executions>
					<execution>
						<goals>
							<goal>toolchain</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-clean-plugin</artifactId>
					<version>${plugin-maven-clean-version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-toolchains-plugin</artifactId>
					<version>${plugin-maven-toolchains-version}</version>
					<configuration>
						<toolchains>
							<jdk>
								<version>openjdk-1.8.0</version>
							</jdk>
						</toolchains>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-resources-plugin</artifactId>
					<version>${plugin-maven-resources-version}</version>
				</plugin>
				<plugin>
					<groupId>com.mycila</groupId>
					<artifactId>license-maven-plugin</artifactId>
					<version>${plugin-mycila-license-version}</version>
					<configuration>
						<properties>
							<year>2023</year>
							<owner>VenaNocta</owner>
							<email>venanocta@gmail.com</email>
						</properties>
						<mapping>
							<java>SLASHSTAR_STYLE</java>
						</mapping>
						<licenseSets>
							<licenseSet>
								<header>${root-dir}/src/license/header.txt</header>
								<excludes>
									<exclude>**/.mvn/repo/**</exclude>
									<exclude>**/resources/**</exclude>
									<exclude>**/license/**</exclude>
									<exclude>**/target/**</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>
					<!-- don't add groupId here it bricks inherited version -->
					<artifactId>maven-plugin-plugin</artifactId>
					<version>${maven-plugin-plugin-version}</version>
				</plugin>
				<plugin>
					<groupId>org.codehaus.plexus</groupId>
					<artifactId>plexus-component-metadata</artifactId>
					<version>${plexus-component-version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>${plugin-maven-compiler-version}</version>
					<configuration>
						<source>${java-source-version}</source>
						<target>${java-target-version}</target>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>${plugin-maven-source-version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>${plugin-maven-javadoc-version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-gpg-plugin</artifactId>
					<version>${plugin-maven-gpg-version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-install-plugin</artifactId>
					<version>${plugin-maven-install-version}</version>
				</plugin>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>build-helper-maven-plugin</artifactId>
					<version>${plugin-mojohaus-build-helper-version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>${plugin-maven-deploy-version}</version>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
</project>
