<?xml version="1.0" encoding="UTF-8"?>
<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">
	<prerequisites>
		<maven>3.0</maven>
	</prerequisites>
	<modelVersion>4.0.0</modelVersion>
	
	<groupId>com.inqwise</groupId>
	<artifactId>inqwise-errors</artifactId>
	<version>1.0.0</version>
	<description>A structured error handling library for Java applications. Supports custom error codes, detailed error tickets, exception normalization, and stack trace focusing. Designed for integration with Vert.x and complex enterprise systems.</description>
	<name>Inqwise Errors - errors library</name>
	
	<organization>
		<name>inqwise</name>
	</organization>
	
	<url>https://github.com/inqwise</url>
	
	<developers>
		<developer>
			<id>alex-inqwise</id>
            <name>Alex Misyuk</name>
            <email>alex@inqwise.com</email>
            <organization>inqwise</organization>
            <organizationUrl>https://www.inqwise.com</organizationUrl>
		</developer>
	</developers>
	
	<licenses>
		<license>
			<name>The Apache Software License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<scm>
		<connection>scm:git:git@github.com:inqwise/inqwise-errors.git</connection>
		<developerConnection>scm:git:git@github.com:inqwise/inqwise-errors.git</developerConnection>
		<url>git@github.com:inqwise/inqwise-errors.git</url>
	</scm>
	
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.version>3.6.3</maven.version>
		<java.version>21</java.version>
		<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
		<junit5.version>5.10.1</junit5.version>
		<maven-flatten-plugin.version>1.5.0</maven-flatten-plugin.version>
		<maven.gpg.plugin.version>1.6</maven.gpg.plugin.version>
		<maven.javadoc.plugin.version>3.5.0</maven.javadoc.plugin.version>
		
		<guava.version>33.0.0-jre</guava.version>
		<jackson.version>2.17.2</jackson.version>
		<log4j2.version>2.22.1</log4j2.version>
		<vertx.version>4.5.10</vertx.version>
    </properties>
	
	<dependencies>
		<dependency>
			<groupId>io.vertx</groupId>
			<artifactId>vertx-core</artifactId>
			<version>${vertx.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-core</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-api</artifactId>
		</dependency>
		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.datatype</groupId>
			<artifactId>jackson-datatype-jsr310</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>io.vertx</groupId>
     		<artifactId>vertx-junit5</artifactId>
     		<version>${vertx.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-api</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-params</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>
	
	<dependencyManagement>
		<dependencies>			
			<dependency>
				<groupId>org.junit.jupiter</groupId>
				<artifactId>junit-jupiter-api</artifactId>
				<version>${junit5.version}</version>
			</dependency>
			<dependency>
				<groupId>org.junit.jupiter</groupId>
				<artifactId>junit-jupiter-engine</artifactId>
				<version>${junit5.version}</version>
			</dependency>
			<dependency>
				<groupId>org.junit.jupiter</groupId>
				<artifactId>junit-jupiter-params</artifactId>
				<version>${junit5.version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.logging.log4j</groupId>
				<artifactId>log4j-api</artifactId>
				<version>${log4j2.version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.logging.log4j</groupId>
				<artifactId>log4j-core</artifactId>
				<version>${log4j2.version}</version>
			</dependency>
			<dependency>
				<groupId>com.google.guava</groupId>
				<artifactId>guava</artifactId>
				<version>${guava.version}</version>
			</dependency>
			<dependency>
				<groupId>com.fasterxml.jackson.core</groupId>
				<artifactId>jackson-databind</artifactId>
				<version>${jackson.version}</version>
			</dependency>
			<dependency>
				<groupId>com.fasterxml.jackson.datatype</groupId>
				<artifactId>jackson-datatype-jsr310</artifactId>
				<version>${jackson.version}</version>
			</dependency>
		</dependencies>
	</dependencyManagement>
	
	<build>
		<plugins>
			<!-- Javadocs Plugin -->
		    <plugin>
		      <groupId>org.apache.maven.plugins</groupId>
		      <artifactId>maven-javadoc-plugin</artifactId>
		      <version>${maven.javadoc.plugin.version}</version>
		      <executions>
		        <execution>
		          <id>attach-javadocs</id>
		          <goals>
		            <goal>jar</goal>
		          </goals>
		        </execution>
		      </executions>
		    </plugin>
		    <plugin>
		      <groupId>org.apache.maven.plugins</groupId>
		      <artifactId>maven-gpg-plugin</artifactId>
		      <version>${maven.gpg.plugin.version}</version>
		      <executions>
		        <execution>
		          <id>sign-artifacts</id>
		          <phase>verify</phase>
		          <goals>
		            <goal>sign</goal>
		          </goals>
		        </execution>
		      </executions>
		      <configuration>
		      	<keyname>5C47F612585CBAF5873E8CADEDEA7939FEE09C62</keyname>
			    <passphraseServerId>gpg.passphrase</passphraseServerId>
			    <gpgArguments>
			      <arg>--pinentry-mode</arg>
			      <arg>loopback</arg>
			    </gpgArguments>
		      </configuration>
		    </plugin>
			<plugin>
				<inherited>true</inherited>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-enforcer-plugin</artifactId>
				<version>3.5.0</version>
				<executions>
					<execution>
						<id>enforce-versions</id>
						<goals>
							<goal>enforce</goal>
						</goals>
						<configuration>
							<rules>
								<banDuplicatePomDependencyVersions/>
								<bannedPlugins>
									<!-- will only display a warning but does not fail the build. -->
									<level>WARN</level>
									<excludes>
										<exclude>org.apache.maven.plugins:maven-verifier-plugin</exclude>
									</excludes>
									<message>Please consider using the maven-invoker-plugin (http://maven.apache.org/plugins/maven-invoker-plugin/)!</message>
								</bannedPlugins>
								<requireMavenVersion>
									<version>${maven.version}</version>
								</requireMavenVersion>
								<requireJavaVersion>
				  					<version>${java.version}</version>
								</requireJavaVersion>
							</rules>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>3.1.2</version>
				<configuration>
					<argLine>--illegal-access=permit -Dvertx.logger-delegate-factory-class-name=io.vertx.core.logging.Log4j2LogDelegateFactory</argLine>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>org.junit.jupiter</groupId>
						<artifactId>junit-jupiter-engine</artifactId>
						<version>${junit5.version}</version>
					</dependency>
				</dependencies>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>3.3.0</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>${maven-compiler-plugin.version}</version>
				<configuration>
					<forceJavacCompilerUse>true</forceJavacCompilerUse>
					<release>${java.version}</release>
					<generatedSourcesDirectory>src/main/generated</generatedSourcesDirectory>
					<generatedTestSourcesDirectory>src/test/generated</generatedTestSourcesDirectory>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-clean-plugin</artifactId>
				<configuration>
					<filesets>
						<fileset>
							<directory>${basedir}</directory>
							<includes>
								<include>**/generated/**</include>
								<include>**/surface-reports/**</include>
								<include>**/target/**</include>
								<include>**/*.log</include>
								
							</includes>
						</fileset>
					</filesets>
				</configuration>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-clean-plugin</artifactId>
					<version>3.3.1</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>3.1.1</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-install-plugin</artifactId>
					<version>3.1.1</version>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
	<profiles>
		<profile>
			<id>sonatype-oss-release</id>
			<build>
				<plugins>
				    <plugin>
				      <groupId>org.sonatype.central</groupId>
				      <artifactId>central-publishing-maven-plugin</artifactId>
				      <version>0.6.0</version>
				      <extensions>true</extensions>
				      <configuration>
				        <publishingServerId>sonatype-oss-release</publishingServerId>
				      </configuration>
				    </plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-enforcer-plugin</artifactId>
						<executions>
							<execution>
								<id>enforce-no-vertx-snapshots</id>
								<goals>
									<goal>enforce</goal>
								</goals>
								<configuration>
									<rules>
										<requireJavaVersion>
											<message>inqwise-errors must be released with Java 21!</message>
											<version>[21,)</version>
										</requireJavaVersion>
										<requireReleaseDeps>
											<message>No inqwise-errors Snapshots Allowed during a release!</message>
											<includes>
												<include>com.inqwise:*</include>
											</includes>
										</requireReleaseDeps>
									</rules>
									<fail>true</fail>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>

