<!--

    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>
	<parent>
		<groupId>net.runeduniverse.tools.build-helper</groupId>
		<artifactId>build-helper-generic</artifactId>
		<version>1</version>
		<relativePath>../maven-generic/pom.xml</relativePath>
	</parent>

	<artifactId>build-helper-java</artifactId>
	<packaging>pom</packaging>
	<version>${project.parent.version}.1</version>

	<name>Build Helper Java</name>
	<description>contains dependency management for build/install/deploy of maven projects</description>
	<url>https://github.com/RunedUniverse/build-helper</url>
	<inceptionYear>2021</inceptionYear>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<!-- VERSIONS -->
		<java-source-version>1.8</java-source-version>
		<java-target-version>${java-source-version}</java-target-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-surefire-version>3.0.0-M5</plugin-maven-surefire-version>
		<!-- VERSIONS - COMPILER -->
		<lombok-version>1.18.12</lombok-version>
		<!-- VERSIONS - TESTING -->
		<junit-platform-launcher-version>1.8.2</junit-platform-launcher-version>
		<junit-platform-runner-version>1.8.2</junit-platform-runner-version>
		<junit-jupiter-api-version>5.8.2</junit-jupiter-api-version>
		<junit-jupiter-engine-version>5.8.2</junit-jupiter-engine-version>
	</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>
		<!-- ACTIONS -->
		<profile>
			<id>install</id>
			<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-compiler-plugin:compile
					org.apache.maven.plugins:maven-resources-plugin:testResources
					org.apache.maven.plugins:maven-compiler-plugin:testCompile
					org.apache.maven.plugins:maven-jar-plugin:jar
					org.apache.maven.plugins:maven-source-plugin:jar-no-fork
					org.apache.maven.plugins:maven-javadoc-plugin:jar
					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-compiler-plugin</artifactId>
						<executions>
							<execution>
								<id>jenkins</id>
								<inherited>true</inherited>
								<phase>compile</phase>
								<goals>
									<goal>compile</goal>
								</goals>
							</execution>
							<execution>
								<id>jenkins-testing</id>
								<inherited>true</inherited>
								<phase>test-compile</phase>
								<goals>
									<goal>testCompile</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-jar-plugin</artifactId>
						<executions>
							<execution>
								<id>jenkins</id>
								<inherited>true</inherited>
								<phase>package</phase>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
							<execution>
								<id>jenkins-testing</id>
								<inherited>true</inherited>
								<phase>package</phase>
								<goals>
									<goal>test-jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<executions>
							<execution>
								<id>jenkins</id>
								<inherited>true</inherited>
								<phase>package</phase>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
							<execution>
								<id>jenkins-testing</id>
								<inherited>true</inherited>
								<phase>package</phase>
								<goals>
									<goal>test-jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<executions>
							<execution>
								<id>jenkins</id>
								<inherited>true</inherited>
								<phase>package</phase>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
							<execution>
								<id>jenkins-testing</id>
								<inherited>true</inherited>
								<phase>package</phase>
								<goals>
									<goal>test-jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>test-junit-jupiter</id>
			<properties>
				<tracing-stage>test-junit-jupiter</tracing-stage>
			</properties>
			<build>
				<defaultGoal>
					org.apache.maven.plugins:maven-help-plugin:effective-pom
					org.apache.maven.plugins:maven-surefire-plugin:test
				</defaultGoal>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-resources-plugin</artifactId>
						<executions>
							<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-compiler-plugin</artifactId>
						<executions>
							<execution>
								<id>jenkins-testing</id>
								<inherited>true</inherited>
								<phase>test-compile</phase>
								<goals>
									<goal>testCompile</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<executions>
							<execution>
								<id>jenkins-testing</id>
								<inherited>true</inherited>
								<phase>test</phase>
								<goals>
									<goal>test</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<trimStackTrace>false</trimStackTrace>
						</configuration>
						<dependencies>
							<dependency>
								<groupId>org.junit.jupiter</groupId>
								<artifactId>junit-jupiter-engine</artifactId>
								<version>${junit-jupiter-engine-version}</version>
							</dependency>
						</dependencies>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>deploy</id>
			<build>
				<defaultGoal>
					org.apache.maven.plugins:maven-help-plugin:effective-pom
					org.apache.maven.plugins:maven-jar-plugin:jar
					org.apache.maven.plugins:maven-deploy-plugin:deploy
				</defaultGoal>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-help-plugin</artifactId>
						<executions>
							<execution>
								<phase>package</phase>
								<goals>
									<goal>all-profiles</goal>
									<goal>active-profiles</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-jar-plugin</artifactId>
						<executions>
							<execution>
								<id>jenkins</id>
								<inherited>true</inherited>
								<phase>package</phase>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>deploy-signed</id>
			<build>
				<defaultGoal>
					org.apache.maven.plugins:maven-help-plugin:effective-pom
					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.apache.maven.plugins</groupId>
						<artifactId>maven-help-plugin</artifactId>
						<executions>
							<execution>
								<phase>package</phase>
								<goals>
									<goal>all-profiles</goal>
									<goal>active-profiles</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-jar-plugin</artifactId>
						<executions>
							<execution>
								<id>jenkins</id>
								<inherited>true</inherited>
								<phase>package</phase>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<!-- re-configured -->
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>build-helper-maven-plugin</artifactId>
						<executions>
							<execution>
								<!-- must be here or it gets overridden! -->
								<id>jenkins</id>
								<inherited>true</inherited>
								<phase>verify</phase>
								<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>
		<!-- HELPER - PROFILES -->
		<profile>
			<id>helper-properties</id>
			<properties>
				<root-dir>${project.parent.basedir}</root-dir>
			</properties>
		</profile>
	</profiles>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.projectlombok</groupId>
				<artifactId>lombok</artifactId>
				<version>${lombok-version}</version>
				<scope>provided</scope>
			</dependency>
			<dependency>
				<groupId>org.junit.jupiter</groupId>
				<artifactId>junit-jupiter-api</artifactId>
				<version>${junit-jupiter-api-version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.junit.jupiter</groupId>
				<artifactId>junit-jupiter-engine</artifactId>
				<version>${junit-jupiter-engine-version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.junit.platform</groupId>
				<artifactId>junit-platform-launcher</artifactId>
				<version>${junit-platform-launcher-version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.junit.platform</groupId>
				<artifactId>junit-platform-runner</artifactId>
				<version>${junit-platform-runner-version}</version>
				<scope>test</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>${plugin-maven-compiler-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>
					<configuration>
						<source>${java-source-version}</source>
						<target>${java-target-version}</target>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<version>${plugin-maven-jar-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-source-plugin</artifactId>
					<version>${plugin-maven-source-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-javadoc-plugin</artifactId>
					<version>${plugin-maven-javadoc-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-surefire-plugin</artifactId>
					<version>${plugin-maven-surefire-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>
					<configuration>
						<trimStackTrace>false</trimStackTrace>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
</project>