<?xml version="1.0" encoding="UTF-8" ?>
<!--
  Copyright (C) 2020 FVA GmbH

  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>io.github.fva-net</groupId>
	<artifactId>rexs-api-java-project</artifactId>
	<version>0.13.0</version>
	<packaging>pom</packaging>

	<name>REXS-API-Java :: Project</name>
	<description>The REXS API Java library contains core utility classes for the REXS interface.</description>
	<url>https://github.com/fva-net/rexs-api-java</url>

	<organization>
		<name>FVA GmbH</name>
		<url>https://www.fva-service.de/</url>
	</organization>

	<issueManagement>
		<system>redmine</system>
		<url>https://access.rexs.info/</url>
	</issueManagement>

	<licenses>
		<license>
			<name>Apache 2.0</name>
			<url>LICENSE.txt</url>
		</license>
	</licenses>

	<developers>
		<developer>
			<name>Karsten Röthig</name>
			<email>karsten.roethig@fva-service.de</email>
			<organization>FVA GmbH</organization>
		</developer>
	</developers>

	<modules>
		<module>api</module>
		<module>cli</module>
	</modules>

	<prerequisites>
		<maven>3.8.5</maven>
	</prerequisites>

	<properties>
		<java.version>17</java.version>

		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.build.outputEncoding>UTF-8</project.build.outputEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

		<spring.boot.version>3.4.2</spring.boot.version>
	</properties>

	<dependencyManagement>
		<dependencies>

			<!-- Spring Boot -->
			<dependency>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-dependencies</artifactId>
				<version>${spring.boot.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>

			<!-- JCommander (see http://jcommander.org/) -->
			<dependency>
				<groupId>com.beust</groupId>
				<artifactId>jcommander</artifactId>
				<version>1.82</version>
			</dependency>

			<!-- JAXB @XmlElementWrapper Plugin (see https://github.com/dmak/jaxb-xew-plugin) -->
			<dependency>
				<groupId>com.github.jaxb-xew-plugin</groupId>
				<artifactId>jaxb-xew-plugin</artifactId>
				<version>2.1</version>
			</dependency>

			<!-- Modules -->
			<dependency>
				<groupId>${project.groupId}</groupId>
				<artifactId>rexs-api-java</artifactId>
				<version>${project.version}</version>
			</dependency>

		</dependencies>
	</dependencyManagement>

	<build>
		<pluginManagement>
			<plugins>

				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>build-helper-maven-plugin</artifactId>
					<version>3.6.0</version>
				</plugin>

				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>buildnumber-maven-plugin</artifactId>
					<version>3.2.1</version>
					<configuration>
						<revisionOnScmFailure>ERR</revisionOnScmFailure>
						<timestampFormat>{0,date,yyyy-MM-dd HH:mm:ss}</timestampFormat>
						<!-- Get the scm revision once for all modules -->
						<getRevisionOnlyOnce>true</getRevisionOnlyOnce>
						<!-- Don't fail on modified local resources -->
						<doCheck>false</doCheck>
						<!-- Don't update SCM -->
						<doUpdate>false</doUpdate>
						<!-- Use short version of git revision -->
						<shortRevisionLength>7</shortRevisionLength>
						<!--skip>true</skip-->
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>jaxb2-maven-plugin</artifactId>
					<version>3.2.0</version>
					<configuration>
						<locale>en</locale>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>3.3.1</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>3.11.2</version>
					<configuration>
						<quiet>true</quiet>
						<tags>
							<tag>
								<name>apiNote</name>
								<placement>a</placement>
								<head>API Note:</head>
							</tag>
						</tags>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.13.0</version>
					<configuration>
						<release>${java.version}</release>
						<source>${java.version}</source>
						<target>${java.version}</target>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<version>3.4.2</version>
					<configuration>
						<archive>
							<manifest>
								<!-- This will add the following to the manifest file: -->
								<!--   Implementation-Title: ${pom.name} -->
								<!--   Implementation-Version: ${pom.version} -->
								<!--   Implementation-Vendor-Id: ${pom.groupId} -->
								<!--   Implementation-Vendor: ${pom.organization.name} -->
								<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
							</manifest>
						</archive>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.springframework.boot</groupId>
					<artifactId>spring-boot-maven-plugin</artifactId>
					<version>${spring.boot.version}</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-assembly-plugin</artifactId>
					<version>3.7.1</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-site-plugin</artifactId>
					<version>3.21.0</version>
					<configuration>
						<skip>true</skip>
						<skipDeploy>true</skipDeploy>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-gpg-plugin</artifactId>
					<version>3.2.7</version>
				</plugin>

				<plugin>
					<groupId>org.sonatype.central</groupId>
					<artifactId>central-publishing-maven-plugin</artifactId>
					<version>0.7.0</version>
				</plugin>

			</plugins>
		</pluginManagement>

		<plugins>

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>buildnumber-maven-plugin</artifactId>
				<executions>
					<execution>
						<phase>validate</phase>
						<goals>
							<goal>create</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

		</plugins>
	</build>

	<profiles>

		<profile>
			<id>release</id>
			<build>
				<plugins>

					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
								<configuration>
									<gpgArguments>
										<arg>--pinentry-mode</arg>
										<arg>loopback</arg>
									</gpgArguments>
								</configuration>
							</execution>
						</executions>
					</plugin>

					<plugin>
						<groupId>org.sonatype.central</groupId>
						<artifactId>central-publishing-maven-plugin</artifactId>
						<extensions>true</extensions>
						<configuration>
							<publishingServerId>central</publishingServerId>
							<autoPublish>true</autoPublish>
						</configuration>
					</plugin>

				</plugins>
			</build>
		</profile>

	</profiles>

	<scm>
		<url>http://github.com/fva-net/rexs-api-java/tree/main</url>
		<connection>scm:git:git://github.com/fva-net/rexs-api-java.git</connection>
		<developerConnection>scm:git:ssh://git@github.com/fva-net/rexs-api-java.git</developerConnection>
	</scm>

</project>
