<!--

    Copyright © 2024 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>

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

	<artifactId>r4m-maven-extension</artifactId>
	<version>${major-version}.${minor-version}.${artifact-version}</version>
	<packaging>maven-plugin</packaging>

	<name>Runes4Maven Extension</name>
	<url>https://github.com/RunedUniverse/r4m-maven-extension</url>
	<inceptionYear>2022</inceptionYear>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<root-dir>..</root-dir>
		<!-- VERSIONS -->
		<artifact-version>1</artifact-version>
		<sources-version>1</sources-version>
		<api-version>0</api-version>
		<model-version>0</model-version>
		<model-builder-version>0</model-builder-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>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>

	<prerequisites>
		<maven>${maven-version-min}</maven>
	</prerequisites>

	<dependencies>
		<dependency>
			<groupId>net.runeduniverse.tools.maven.r4m</groupId>
			<artifactId>r4m-api</artifactId>
			<version>${major-version}.${minor-version}.${api-version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>net.runeduniverse.tools.maven.r4m</groupId>
			<artifactId>r4m-model</artifactId>
			<version>${major-version}.${minor-version}.${model-version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>net.runeduniverse.tools.maven.r4m</groupId>
			<artifactId>r4m-model-builder</artifactId>
			<version>${major-version}.${minor-version}.${model-builder-version}</version>
			<scope>compile</scope>
		</dependency>

		<dependency>
			<groupId>org.apache.maven</groupId>
			<artifactId>maven-core</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.codehaus.plexus</groupId>
			<artifactId>plexus-utils</artifactId>
			<scope>provided</scope>
			<!-- maven doesn't provide it to extensions -->
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
			<scope>compile</scope>
			<!-- ============================================================== -->
			<!-- In some cases where maven is executed indirectly,              -->
			<!-- this reference is not inherited from maven-core!               -->
			<!-- + such an occurrence is eclipse's maven integration (m2e)      -->
			<!-- ============================================================== -->
		</dependency>

		<!-- logging utilities-->
		<dependency>
			<groupId>net.runeduniverse.lib.utils</groupId>
			<artifactId>utils-common</artifactId>
		</dependency>
		<dependency>
			<groupId>net.runeduniverse.lib.utils</groupId>
			<artifactId>utils-logging</artifactId>
		</dependency>

		<!-- COMPILER -->
		<!-- dependency for plexus annotation -->
		<dependency>
			<groupId>org.codehaus.plexus</groupId>
			<artifactId>plexus-component-annotations</artifactId>
			<scope>provided</scope>
		</dependency>
	</dependencies>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>net.runeduniverse.tools.maven.r4m</groupId>
				<artifactId>r4m-bom-sources</artifactId>
				<version>${major-version}.${minor-version}.${sources-version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<profiles>
		<!-- PIPELINE -->
		<profile>
			<id>install</id>
			<build>
				<defaultGoal>clean install</defaultGoal>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<executions>
							<execution>
								<goals>
									<goal>jar</goal>
								</goals>
								<configuration>
									<!-- ignore maven-plugin-plugin annotations -->
									<doclint>none</doclint>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<build>
		<resources>
			<resource>
				<directory>src/main/maven</directory>
				<targetPath>META-INF/maven</targetPath>
			</resource>
			<resource>
				<directory>src/main/r4m</directory>
				<targetPath>META-INF/r4m</targetPath>
			</resource>
			<resource>
				<directory>${basedir}</directory>
				<targetPath>META-INF</targetPath>
				<includes>
					<include>LICENSE</include>
				</includes>
			</resource>
		</resources>

		<plugins>
			<plugin>
				<!-- don't add groupId here it bricks inherited version -->
				<artifactId>maven-plugin-plugin</artifactId>
				<configuration>
					<goalPrefix>r4m</goalPrefix>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.codehaus.plexus</groupId>
				<artifactId>plexus-component-metadata</artifactId>
				<configuration>
					<staticMetadataDirectory>src/main/plexus</staticMetadataDirectory>
					<testStaticMetadataDirectory>src/test/plexus</testStaticMetadataDirectory>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>generate-metadata</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
