<!-- 
   Copyright 2024 Christian Heina

   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>com.christianheina.common</groupId>
	<artifactId>common-math</artifactId>
	<version>0.0.1</version>
	<packaging>jar</packaging>

	<name>Common Math</name>
	<description>Common math functions</description>
	<url>https://github.com/christianheina/common-math</url>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
		<commonsmath3.version>3.6.1</commonsmath3.version>
		<jtransforms.version>3.1</jtransforms.version>
		<testng.version>7.10.2</testng.version>
		<formatter-maven-plugin.version>2.16.0</formatter-maven-plugin.version>
		<maven-release-plugin.version>3.0.0-M4</maven-release-plugin.version>
		<maven-deploy-plugin.version>3.0.0-M1</maven-deploy-plugin.version>
		<maven-checkstyle-plugin.version>2.15</maven-checkstyle-plugin.version>
		<maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version>
		<maven-source-plugin.version>3.2.0</maven-source-plugin.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-math3</artifactId>
			<version>${commonsmath3.version}</version>
		</dependency>
		<dependency>
			<groupId>com.github.wendykierp</groupId>
			<artifactId>JTransforms</artifactId>
			<version>${jtransforms.version}</version>
		</dependency>
		<dependency>
			<groupId>org.testng</groupId>
			<artifactId>testng</artifactId>
			<version>${testng.version}</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
	<build>
		<testResources>
			<testResource>
				<directory>src/site</directory>
			</testResource>
			<testResource>
				<directory>src/test/resources</directory>
			</testResource>
		</testResources>
		<plugins>
			<plugin>
				<groupId>net.revelc.code.formatter</groupId>
				<artifactId>formatter-maven-plugin</artifactId>
				<version>${formatter-maven-plugin.version}</version>
				<configuration>
					<lineEnding>LF</lineEnding>
					<compilerSource>${maven.compiler.source}</compilerSource>
					<compilerCompliance>${maven.compiler.target}</compilerCompliance>
					<compilerTargetPlatform>${maven.compiler.target}</compilerTargetPlatform>
					<encoding>${project.build.sourceEncoding}</encoding>
					<skipCssFormatting>true</skipCssFormatting>
					<directories>
						<directory>${basedir}</directory>
					</directories>
					<excludes>
						<exclude>**/docs/**</exclude>
						<exclude>**/target/**</exclude>
						<exclude>**/test-output/**</exclude>
					</excludes>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>format</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<version>${maven-release-plugin.version}</version>
				<configuration>
					<preparationGoals>clean verify</preparationGoals>
					<goals>deploy</goals>
					<autoVersionSubmodules>true</autoVersionSubmodules>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-deploy-plugin</artifactId>
				<version>${maven-deploy-plugin.version}</version>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-checkstyle-plugin</artifactId>
				<version>${maven-checkstyle-plugin.version}</version>
				<configuration>
					<logViolationsToConsole>true</logViolationsToConsole>
					<checkstyleRules>
						<module name="JavadocMethod">
							<property name="scope" value="public" />
							<property name="allowUndeclaredRTE" value="true" />
							<property name="allowMissingParamTags" value="false" />
						</module>
					</checkstyleRules>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>${maven-javadoc-plugin.version}</version>
				<executions>
					<execution>
						<id>attach-javadoc</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>${maven-source-plugin.version}</version>
				<executions>
					<execution>
						<id>attach-source</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<configuration>
					<descriptorRefs>
						<descriptorRef>jar-with-dependencies</descriptorRef>
					</descriptorRefs>
				</configuration>
			</plugin>
		</plugins>
	</build>
	<profiles>
		<profile>
			<id>deploy</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>3.0.1</version>
						<configuration>
							<gpgArguments>
								<arg>--pinentry-mode</arg>
								<arg>loopback</arg>
							</gpgArguments>
						</configuration>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
	<licenses>
		<license>
			<name>Apache License, Version 2.0</name>
			<url>https://www.apache.org/licenses/LICENSE-2.0</url>
		</license>
	</licenses>
	<developers>
		<developer>
			<name>Christian Heina</name>
			<email>developer@christianheina.com</email>
		</developer>
	</developers>
	<distributionManagement>
		<repository>
			<id>ossrh</id>
			<name>Central Repository OSSRH</name>
			<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
	</distributionManagement>
	<scm>
		<connection>scm:git:https://github.com/christianheina/common-math.git</connection>
		<developerConnection>scm:git:https://github.com/christianheina/common-math.git</developerConnection>
		<url>https://github.com/christianheina/common-math/tree/main</url>
		<tag>common-math-0.0.1</tag>
	</scm>
	<issueManagement>
		<url>https://github.com/christianheina/common-math/issues</url>
		<system>github</system>
	</issueManagement>
	<ciManagement>
		<system>Github Actions</system>
		<url>https://github.com/christianheina/common-math/actions</url>
	</ciManagement>
</project>
