<?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">

	<modelVersion>4.0.0</modelVersion>
	<groupId>io.jans</groupId>
	<artifactId>jans-config-api-parent</artifactId>
	<packaging>pom</packaging>
	<version>2.1.0</version>
	<name>jans-config-api-parent</name>

	<distributionManagement>
		<repository>
			<id>github</id>
			<name>GitHub Packages</name>
			<url>https://maven.pkg.github.com/JanssenProject/jans</url>
		</repository>
	</distributionManagement>
	<properties>
		<maven.min-version>3.3.9</maven.min-version>
		<compiler-plugin.version>3.11.0</compiler-plugin.version>
		<maven.compiler.parameters>true</maven.compiler.parameters>
		<maven.compiler.source>11</maven.compiler.source>
		<maven.compiler.target>11</maven.compiler.target>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<surefire-plugin.version>3.5.4</surefire-plugin.version>

		<jans.version>${project.version}</jans.version>
		
		<resteasy.version>6.2.3.Final</resteasy.version>
		<jackson.version>2.18.6</jackson.version>
		<jetty.version>11.0.25</jetty.version>
		<weld.version>4.0.3.Final</weld.version>	

		<microprofile.config.version>3.1</microprofile.config.version>
		<microprofile.health.version>4.0</microprofile.health.version>
		<microprofile.metrics.version>4.0</microprofile.metrics.version>
		<microprofile.rest.client.version>3.0</microprofile.rest.client.version>
		<smallrye.config.version>3.0.0-RC1</smallrye.config.version>
		<smallrye.metrics.version>4.0.0-RC1</smallrye.metrics.version>
		<org.jboss.resteasy.client.microprofile.version>4.7.5.Final</org.jboss.resteasy.client.microprofile.version>

		<rest-assured.version>5.0.1</rest-assured.version>
		<testng.version>7.8.0</testng.version>
		<snake.version>2.0</snake.version>
		<jupiter.version>5.7.0</jupiter.version>
		<cucumber.version>3.8.0</cucumber.version>
		<jacoco.version>0.8.14</jacoco.version>
		<mapstruct.version>1.5.3.Final</mapstruct.version>
		<swagger.version>2.2.11</swagger.version>

		<sonar.projectKey>JanssenProject_jans-config-api</sonar.projectKey>
		<sonar.moduleKey>${project.groupId}:${project.artifactId}</sonar.moduleKey>
		<sonar.organization>janssenproject</sonar.organization>
		<sonar.host.url>https://sonarcloud.io</sonar.host.url>

		<swagger-maven-plugin-jakarta>2.2.34</swagger-maven-plugin-jakarta>
		<swagger-models-jakarta>2.2.43</swagger-models-jakarta>
		
        <apache.james.version>0.8.10</apache.james.version>
	</properties>

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

	<modules>
		<module>common</module>
		<module>shared</module>
		<module>server</module>
		<module>server-fips</module>
		<module>plugins</module>
	</modules>

	<repositories>
        <repository>
           <id>github</id>
           <name>GitHub Packages</name>
           <url>https://maven.pkg.github.com/JanssenProject/jans</url>
        </repository>
		<repository>
			<id>mavencentral</id>
			<name>maven central</name>
			<url>https://repo1.maven.org/maven2</url>
		</repository>
		<repository>
			<id>jans</id>
			<name>Janssen project repository</name>
			<url>https://maven.jans.io/maven</url>
		</repository>
		<repository>
			<id>bouncycastle</id>
			<name>Bouncy Castle</name>
			<url>https://repo1.maven.org/maven2/org/bouncycastle</url>
		</repository>

	</repositories>

	<scm>
		<url>https://github.com/JanssenProject/jans-config-api</url>
		<connection>scm:git:git://github.com/JanssenProject/jans-config-api.git</connection>
		<developerConnection>scm:git:git@github.com:v/jans-config-api.git</developerConnection>
	</scm>

	<dependencyManagement>
		<dependencies>

            <dependency>
                <groupId>io.jans</groupId>
                <artifactId>jans-bom</artifactId>
                <version>${jans.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
			<dependency>
				<groupId>com.fasterxml.jackson</groupId>
				<artifactId>jackson-bom</artifactId>
				<version>${jackson.version}</version>
				<scope>import</scope>
				<type>pom</type>
			</dependency>
			<!-- Weld -->
			<dependency>
				<groupId>org.jboss.weld</groupId>
				<artifactId>weld-core-parent</artifactId>
				<version>${weld.version}</version>
				<scope>import</scope>
				<type>pom</type>
			</dependency>

			<!-- jans dependencies -->
			<dependency>
				<groupId>io.jans</groupId>
				<artifactId>jans-config-api-common</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>io.jans</groupId>
				<artifactId>jans-config-api-server</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>io.jans</groupId>
				<artifactId>jans-config-api-shared</artifactId>
				<version>${jans.version}</version>
			</dependency>
			<dependency>
				<groupId>io.jans</groupId>
				<artifactId>jans-core-util</artifactId>
				<version>${jans.version}</version>
				<exclusions>
					<exclusion>
						<groupId>org.jboss.resteasy</groupId>
						<artifactId>*</artifactId>
					</exclusion>
					<exclusion>
						<groupId>org.apache.jackrabbit</groupId>
						<artifactId>jackrabbit-core</artifactId>
					</exclusion>
				</exclusions>
			</dependency>
			<dependency>
				<groupId>io.jans</groupId>
				<artifactId>jans-core-model</artifactId>
				<version>${jans.version}</version>
				<exclusions>
					<exclusion>
						<groupId>org.jboss.resteasy</groupId>
						<artifactId>*</artifactId>
					</exclusion>
					<exclusion>
						<groupId>org.apache.jackrabbit</groupId>
						<artifactId>jackrabbit-core</artifactId>
					</exclusion>
				</exclusions>
			</dependency>
			<dependency>
				<groupId>io.jans</groupId>
				<artifactId>jans-auth-common</artifactId>
				<version>${jans.version}</version>
				<exclusions>
					<exclusion>
						<groupId>org.jboss.resteasy</groupId>
						<artifactId>*</artifactId>
					</exclusion>
					<exclusion>
						<groupId>org.apache.jackrabbit</groupId>
						<artifactId>jackrabbit-core</artifactId>
					</exclusion>
				</exclusions>
			</dependency>
			<dependency>
				<groupId>io.jans</groupId>
				<artifactId>jans-core-server</artifactId>
				<version>${jans.version}</version>
				<exclusions>
					<exclusion>
						<artifactId>org.jboss.resteasy</artifactId>
						<groupId>*</groupId>
					</exclusion>
				</exclusions>
			</dependency>
			<dependency>
				<groupId>io.jans</groupId>
				<artifactId>jans-core-service</artifactId>
				<version>${jans.version}</version>
				<exclusions>
					<exclusion>
						<artifactId>org.jboss.resteasy</artifactId>
						<groupId>*</groupId>
					</exclusion>
				</exclusions>
			</dependency>
			<dependency>
				<groupId>io.jans</groupId>
				<artifactId>jans-orm-annotation</artifactId>
				<version>${jans.version}</version>
			</dependency>
			<dependency>
				<groupId>io.jans</groupId>
				<artifactId>uma-rs-core</artifactId>
				<version>${jans.version}</version>
			</dependency>
			<dependency>
				<groupId>io.jans</groupId>
				<artifactId>agama-model</artifactId>
				<version>${jans.version}</version>
			</dependency>
			<dependency>
				<groupId>io.jans</groupId>
				<artifactId>agama-transpiler</artifactId>
				<version>${jans.version}</version>
			</dependency>

			<!-- Security -->
			<dependency>
				<groupId>org.bitbucket.b_c</groupId>
				<artifactId>jose4j</artifactId>
				<version>0.9.6</version>
				<scope>test</scope>
			</dependency>

			<!-- Microprofile -->
			<dependency>
				<groupId>org.eclipse.microprofile.config</groupId>
				<artifactId>microprofile-config-api</artifactId>
				<version>${microprofile.config.version}</version>
			</dependency>
			<dependency>
				<groupId>org.eclipse.microprofile.health</groupId>
				<artifactId>microprofile-health-api</artifactId>
				<version>${microprofile.health.version}</version>
			</dependency>
			<dependency>
				<groupId>org.eclipse.microprofile.metrics</groupId>
				<artifactId>microprofile-metrics-api</artifactId>
				<version>${microprofile.metrics.version}</version>
			</dependency>
			<dependency>
				<groupId>org.eclipse.microprofile.rest.client</groupId>
				<artifactId>microprofile-rest-client-api</artifactId>
				<version>${microprofile.rest.client.version}</version>
			</dependency>

			<!-- Microprofile implementation smallrye -->
			<dependency>
				<groupId>io.smallrye.config</groupId>
				<artifactId>smallrye-config</artifactId>
				<version>${smallrye.config.version}</version>
			</dependency>
			<dependency>
				<groupId>io.smallrye</groupId>
				<artifactId>smallrye-health</artifactId>
				<version>${smallrye.health.version}</version>
			</dependency>
			<dependency>
				<groupId>io.smallrye</groupId>
				<artifactId>smallrye-metrics</artifactId>
				<version>${smallrye.metrics.version}</version>
			</dependency>
			<dependency>
				<groupId>org.jboss.resteasy</groupId>
				<artifactId>resteasy-client-microprofile</artifactId>
				<version>${org.jboss.resteasy.client.microprofile.version}</version>
			</dependency>

			<!-- jetty -->
			<dependency>
				<groupId>org.eclipse.jetty</groupId>
				<artifactId>jetty-webapp</artifactId>
				<version>${jetty.version}</version>
				<scope>provided</scope>
			</dependency>
			<dependency>
				<groupId>org.eclipse.jetty</groupId>
				<artifactId>jetty-deploy</artifactId>
				<version>${jetty.version}</version>
				<scope>provided</scope>
			</dependency>
			<dependency>
				<groupId>org.eclipse.jetty</groupId>
				<artifactId>jetty-annotations</artifactId>
				<version>${jetty.version}</version>
				<scope>provided</scope>
			</dependency>
			<dependency>
				<groupId>org.eclipse.jetty</groupId>
				<artifactId>jetty-plus</artifactId>
				<version>${jetty.version}</version>
				<scope>provided</scope>
			</dependency>

			<!-- Testing -->
			<dependency>
				<groupId>io.rest-assured</groupId>
				<artifactId>rest-assured</artifactId>
				<version>${rest-assured.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.testng</groupId>
				<artifactId>testng</artifactId>
				<version>${testng.version}</version>
		    </dependency>
		    
			
			<dependency>
				<groupId>net.masterthought</groupId>
				<artifactId>cucumber-reporting</artifactId>
				<version>${cucumber.version}</version>
				<scope>test</scope>
			</dependency>

			<!-- Others -->
			<dependency>
				<groupId>org.apache.commons</groupId>
				<artifactId>commons-collections4</artifactId>
				<version>4.1</version>
			</dependency>
			
            <!-- apache james -->
            <dependency>
            	<groupId>org.apache.james</groupId>
            	<artifactId>apache-mime4j-dom</artifactId>
            	<version>${apache.james.version}</version>
            </dependency>
            <dependency>
            	<groupId>org.apache.james</groupId>
            	<artifactId>apache-mime4j-storage</artifactId>
            	<version>${apache.james.version}</version>
            </dependency>
            <dependency>
            	<groupId>org.apache.james</groupId>
            	<artifactId>apache-mime4j-core</artifactId>
            	<version>${apache.james.version}</version>
            </dependency>  
			
            <!-- mapstruct-->
            <dependency>
            	<groupId>org.mapstruct</groupId>
            	<artifactId>mapstruct</artifactId>
				<version>${mapstruct.version}</version> 
            </dependency>
  			

			<!-- Swagger -->
			<dependency>
				<groupId>io.swagger.core.v3</groupId>
				<artifactId>swagger-core-jakarta</artifactId>
				<version>${swagger.version}</version>
			</dependency>

		</dependencies>
	</dependencyManagement>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-clean-plugin</artifactId>
					<version>3.2.0</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>${compiler-plugin.version}</version>
					<configuration>
						<forceJavacCompilerUse>true</forceJavacCompilerUse>
						<annotationProcessorPaths>  
				            <path>  
				                <groupId>org.mapstruct</groupId>  
				                <artifactId>mapstruct-processor</artifactId>  
				                <version>${mapstruct.version}</version>  
				            </path>  
                        </annotationProcessorPaths>  
					</configuration>
				</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-dependency-plugin</artifactId>
					<version>3.10.0</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-install-plugin</artifactId>
					<version>3.1.1</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<version>3.3.0</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-resources-plugin</artifactId>
					<version>3.5.0</version>
					<configuration>
						<encoding>UTF-8</encoding>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-site-plugin</artifactId>
					<version>4.0.0-M16</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>${surefire-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>com.github.spotbugs</groupId>
					<artifactId>spotbugs-maven-plugin</artifactId>
					<version>4.9.8.2</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-war-plugin</artifactId>
					<version>3.5.1</version>
				</plugin>
				<plugin>
					<groupId>org.eclipse.jetty</groupId>
					<artifactId>jetty-maven-plugin</artifactId>
					<version>${jetty.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>3.2.1</version>
					<executions>
						<execution>
							<id>attach-sources</id>
							<goals>
								<goal>jar</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>3.8.0</version>
					<configuration>
						<failOnError>false</failOnError>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.jacoco</groupId>
					<artifactId>jacoco-maven-plugin</artifactId>
					<version>${jacoco.version}</version>
					<executions>
						<execution>
							<id>prepare-agent-ut</id>
							<goals>
								<goal>prepare-agent</goal>
							</goals>
							<configuration>
								<destFile>${project.build.directory}/jacoco-ut.exec</destFile>
							</configuration>
						</execution>
						<execution>
							<id>prepare-agent-it</id>
							<phase>pre-integration-test</phase>
							<goals>
								<goal>prepare-agent</goal>
							</goals>
							<configuration>
								<destFile>${project.build.directory}/jacoco-it.exec</destFile>
							</configuration>
						</execution>
						<execution>
							<id>jacoco-check</id>
							<goals>
								<goal>check</goal>
							</goals>
							<configuration>
								<rules>
									<rule>
										<element>PACKAGE</element>
										<limits>
											<limit>
												<counter>LINE</counter>
												<value>COVEREDRATIO</value>
												<minimum>0.50</minimum>
											</limit>
										</limits>
									</rule>
								</rules>
							</configuration>
						</execution>
						<execution>
							<id>report-ut</id>
							<goals>
								<goal>report</goal>
							</goals>
							<configuration>
								<dataFile>${project.build.directory}/jacoco-ut.exec</dataFile>
								<outputDirectory>${project.reporting.outputDirectory}/jacoco-ut
								</outputDirectory>
							</configuration>
						</execution>
						<execution>
							<id>report-it</id>
							<phase>post-integration-test</phase>
							<goals>
								<goal>report</goal>
							</goals>
							<configuration>
								<dataFile>${project.build.directory}/jacoco-it.exec</dataFile>
								<outputDirectory>${project.reporting.outputDirectory}/jacoco-it
								</outputDirectory>
							</configuration>
						</execution>
					</executions>
				</plugin>

				<!-- swagger -->
				<plugin>
					<groupId>io.swagger.core.v3</groupId>
					<artifactId>swagger-maven-plugin-jakarta</artifactId>
					<version>${swagger-maven-plugin-jakarta}</version>
					<executions>
						<execution>
							<configuration>
								<outputFormat>YAML</outputFormat>
								<outputPath>${project.parent.basedir}/docs</outputPath>
								<prettyPrint>true</prettyPrint>
								<filterClass>io.jans.configapi.filters.SpecFilter</filterClass>
							</configuration>
							<phase>compile</phase>
							<goals>
								<goal>resolve</goal>
							</goals>
						</execution>
					</executions>
					<dependencies>
						<dependency>
							<groupId>io.swagger.core.v3</groupId>
							<artifactId>swagger-models-jakarta</artifactId>
							<version>${swagger-models-jakarta}</version>
						</dependency>
					</dependencies>
				</plugin>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>buildnumber-maven-plugin</artifactId>
					<version>3.0.0</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-antrun-plugin</artifactId>
					<version>3.1.0</version>
				</plugin>
			</plugins>

		</pluginManagement>
	</build>

	<profiles>
		<profile>
			<id>set-configuration-name</id>
			<activation>
				<property>
					<name>!cfg</name>
				</property>
			</activation>
			<properties>
				<cfg>default</cfg>
			</properties>
		</profile>

		<profile>
			<id>set-skip-test-variable</id>
			<activation>
				<property>
					<name>!maven.test.skip</name>
				</property>
			</activation>
			<properties>
				<maven.test.skip>false</maven.test.skip>
			</properties>
		</profile>
	</profiles>
</project>