<?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>de.adorsys.sts</groupId>
	<artifactId>secure-token-service</artifactId>
	<version>1.0.5</version>
	<packaging>pom</packaging>

	<name>SecureTokenService</name>
	<url>https://github.com/adorsys/secure-token-service</url>
	<description>SecureTokenService modules</description>

	<licenses>
		<license>
			<name>The Apache License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
		</license>
	</licenses>

	<developers>
		<developer>
			<name>Boris Skert</name>
			<email>bsk@adorsys.de</email>
			<organization>adorsys</organization>
			<organizationUrl>https://adorsys.de/</organizationUrl>
		</developer>
		<developer>
			<name>Francis Pouatcha</name>
			<email>fpo@adorsys.de</email>
			<organization>adorsys</organization>
			<organizationUrl>https://adorsys.de/</organizationUrl>
		</developer>
	</developers>

	<scm>
		<connection>scm:git:https://git.adorsys.de/adorsys/secure-token-service.git</connection>
		<developerConnection>scm:git:git@github.com:adorsys/secure-token-service.git</developerConnection>
		<url>git@github.com:adorsys/secure-token-service.git</url>
		<tag>HEAD</tag>
	</scm>

	<properties>
		<java.version>1.8</java.version>
		<maven.compiler.source>${java.version}</maven.compiler.source>
		<maven.compiler.target>${java.version}</maven.compiler.target>
		<maven.build.timestamp.format>yyyy-MM-dd HH:mm:ssZZ</maven.build.timestamp.format>
		<maven.build-timestamp>${maven.build.timestamp}</maven.build-timestamp>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

		<spring-boot.version>2.2.5.RELEASE</spring-boot.version>
		<keystore-management.version>0.0.6</keystore-management.version>
		<schedlock.version>4.5.1</schedlock.version>
		<springfox-swagger.version>2.9.2</springfox-swagger.version>
		<jackson.version>2.10.3</jackson.version>
		<bouncycastle.version>1.64</bouncycastle.version>
		<keycloak.version>7.0.0</keycloak.version>
		<keycloak-config-cli.version>v0.8.0</keycloak-config-cli.version>
		<surefire.version>3.0.0-M4</surefire.version>
		<jacoco.version>0.8.5</jacoco.version>
		<testcontainers.version>1.16.2</testcontainers.version>
		<nimbus-jose-jwt.version>9.14</nimbus-jose-jwt.version>
		<scmBranch />
	</properties>

	<modules>
		<module>sts-common</module>
		<module>sts-pop</module>
		<module>sts-token</module>
		<module>sts-server-info</module>
		<module>sts-token-auth</module>
		<module>sts-resource-server</module>
		<module>sts-example</module>
		<module>sts-keymanagement</module>
		<module>sts-spring</module>
		<module>sts-service-component-example</module>
		<module>sts-persistence-jpa</module>
		<module>sts-persistence-mongo</module>
		<module>sts-secret-server</module>
		<module>sts-secret</module>
		<module>sts-simple-encryption</module>
		<module>keycloak-storage-provider</module>
		<module>sts-e2e-tests</module>
	</modules>

	<dependencyManagement>
		<dependencies>
			<!--https://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-build-systems.html#using-boot-maven-without-a-parent -->
			<dependency>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-dependencies</artifactId>
				<version>${spring-boot.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>

			<dependency>
				<groupId>io.springfox</groupId>
				<artifactId>springfox-swagger2</artifactId>
				<version>${springfox-swagger.version}</version>
			</dependency>
			<dependency>
				<groupId>io.springfox</groupId>
				<artifactId>springfox-swagger-ui</artifactId>
				<version>${springfox-swagger.version}</version>
			</dependency>
			<dependency>
				<groupId>de.adorsys.sts</groupId>
				<artifactId>sts-common</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>de.adorsys.sts</groupId>
				<artifactId>sts-pop</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>de.adorsys.sts</groupId>
				<artifactId>sts-token</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>de.adorsys.sts</groupId>
				<artifactId>sts-token-auth</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>de.adorsys.sts</groupId>
				<artifactId>sts-resource-server</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>de.adorsys.sts</groupId>
				<artifactId>sts-server-info</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>de.adorsys.sts</groupId>
				<artifactId>sts-worksheet-loader</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>de.adorsys.sts</groupId>
				<artifactId>sts-keymanagement</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>de.adorsys.sts</groupId>
				<artifactId>sts-keymanagement-api</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>de.adorsys.sts</groupId>
				<artifactId>sts-keymanagement-impl</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>de.adorsys.sts</groupId>
				<artifactId>sts-spring</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>de.adorsys.sts</groupId>
				<artifactId>sts-persistence-jpa</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>de.adorsys.sts</groupId>
				<artifactId>sts-persistence-mongo</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>de.adorsys.sts</groupId>
				<artifactId>sts-secret</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>de.adorsys.sts</groupId>
				<artifactId>sts-simple-encryption</artifactId>
				<version>${project.version}</version>
			</dependency>

			<dependency>
				<groupId>de.adorsys.keymanagement</groupId>
				<artifactId>api</artifactId>
				<version>${keystore-management.version}</version>
			</dependency>
			<dependency>
				<groupId>de.adorsys.keymanagement</groupId>
				<artifactId>core</artifactId>
				<version>${keystore-management.version}</version>
			</dependency>
			<dependency>
				<groupId>de.adorsys.keymanagement</groupId>
				<artifactId>juggler-bouncycastle</artifactId>
				<version>${keystore-management.version}</version>
			</dependency>

			<dependency>
				<groupId>org.keycloak</groupId>
				<artifactId>keycloak-core</artifactId>
				<version>${keycloak.version}</version>
				<scope>provided</scope>
			</dependency>
			<dependency>
				<groupId>org.keycloak</groupId>
				<artifactId>keycloak-server-spi</artifactId>
				<version>${keycloak.version}</version>
				<scope>provided</scope>
			</dependency>
			<dependency>
				<groupId>org.keycloak</groupId>
				<artifactId>keycloak-server-spi-private</artifactId>
				<version>${keycloak.version}</version>
				<scope>provided</scope>
			</dependency>
			<dependency>
				<groupId>org.keycloak</groupId>
				<artifactId>keycloak-services</artifactId>
				<version>${keycloak.version}</version>
				<scope>provided</scope>
			</dependency>
			<dependency>
				<groupId>org.keycloak</groupId>
				<artifactId>keycloak-model-infinispan</artifactId>
				<version>${keycloak.version}</version>
				<scope>provided</scope>
			</dependency>

			<dependency>
				<groupId>com.nimbusds</groupId>
				<artifactId>nimbus-jose-jwt</artifactId>
				<version>${nimbus-jose-jwt.version}</version>
			</dependency>

			<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on -->
			<dependency>
				<groupId>org.bouncycastle</groupId>
				<artifactId>bcprov-jdk15on</artifactId>
				<version>${bouncycastle.version}</version>
			</dependency>

			<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcpkix-jdk15on -->
			<dependency>
				<groupId>org.bouncycastle</groupId>
				<artifactId>bcpkix-jdk15on</artifactId>
				<version>${bouncycastle.version}</version>
			</dependency>

			<dependency>
				<groupId>net.javacrumbs.shedlock</groupId>
				<artifactId>shedlock-core</artifactId>
				<version>${schedlock.version}</version>
			</dependency>
			<dependency>
				<groupId>net.javacrumbs.shedlock</groupId>
				<artifactId>shedlock-provider-jdbc-template</artifactId>
				<version>${schedlock.version}</version>
			</dependency>
			<dependency>
				<groupId>net.javacrumbs.shedlock</groupId>
				<artifactId>shedlock-provider-mongo</artifactId>
				<version>${schedlock.version}</version>
			</dependency>

			<dependency>
				<groupId>com.fasterxml.jackson</groupId>
				<artifactId>jackson-bom</artifactId>
				<version>${jackson.version}</version>
			</dependency>

			<!-- https://mvnrepository.com/artifact/io.swagger/swagger-annotations -->
			<dependency>
				<groupId>io.swagger</groupId>
				<artifactId>swagger-annotations</artifactId>
				<version>1.6.0</version>
			</dependency>

			<dependency>
				<groupId>com.google.guava</groupId>
				<artifactId>guava</artifactId>
				<version>28.2-jre</version>
			</dependency>

			<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
			<dependency>
				<groupId>org.apache.commons</groupId>
				<artifactId>commons-lang3</artifactId>
				<version>3.9</version>
			</dependency>

			<!-- Database -->
			<dependency>
				<groupId>org.flywaydb</groupId>
				<artifactId>flyway-core</artifactId>
				<version>6.2.4</version>
				<scope>runtime</scope>
			</dependency>
			<dependency>
				<groupId>org.postgresql</groupId>
				<artifactId>postgresql</artifactId>
				<version>42.2.10</version>
				<scope>runtime</scope>
			</dependency>
			<dependency>
				<groupId>com.h2database</groupId>
				<artifactId>h2</artifactId>
				<version>1.4.200</version>
				<scope>runtime</scope>
			</dependency>

			<!-- Testing Libraries -->
			<dependency>
				<groupId>com.nitorcreations</groupId>
				<artifactId>junit-runners</artifactId>
				<version>1.3</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.mockito</groupId>
				<artifactId>mockito-core</artifactId>
				<version>3.3.0</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>eu.codearte.catch-exception</groupId>
				<artifactId>catch-exception</artifactId>
				<version>1.4.6</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.testcontainers</groupId>
				<artifactId>testcontainers</artifactId>
				<version>${testcontainers.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.testcontainers</groupId>
				<artifactId>junit-jupiter</artifactId>
				<version>${testcontainers.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.testcontainers</groupId>
				<artifactId>mysql</artifactId>
				<version>${testcontainers.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.testcontainers</groupId>
				<artifactId>postgresql</artifactId>
				<version>${testcontainers.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-starter-test</artifactId>
				<version>${spring-boot.version}</version>
				<scope>test</scope>
			</dependency>
		</dependencies>

	</dependencyManagement>

	<build>
		<finalName>${project.artifactId}</finalName>

		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>prepare-agent</id>
						<phase>validate</phase>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
					</execution>
					<execution>
						<id>report</id>
						<phase>post-integration-test</phase>
						<goals>
							<goal>report</goal>
						</goals>
					</execution>
					<execution>
						<id>report-aggregate</id>
						<phase>verify</phase>
						<goals>
							<goal>report-aggregate</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<append>true</append>
					<propertyName>surefireArgLine</propertyName>
				</configuration>
			</plugin>
		</plugins>

		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-project-info-reports-plugin</artifactId>
					<version>2.7</version>
				</plugin>
				<!-- For Junit5 -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>${surefire.version}</version>
					<configuration>
						<argLine>${surefireArgLine}</argLine>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.jacoco</groupId>
					<artifactId>jacoco-maven-plugin</artifactId>
					<version>${jacoco.version}</version>
				</plugin>

				<!-- Maven Release Build fails if javadoc comments are invalid. http://stackoverflow.com/questions/15886209/maven-is-not-working-in-java-8-when-javadoc-tags-are-incomplete -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>3.1.1</version>
					<configuration>
						<charset>${project.build.sourceEncoding}</charset>
						<encoding>${project.build.sourceEncoding}</encoding>
						<docencoding>${project.build.sourceEncoding}</docencoding>
						<doclint>none</doclint>
					</configuration>
				</plugin>
				<plugin>
					<artifactId>maven-release-plugin</artifactId>
					<version>3.0.0-M1</version>
					<configuration>
						<releaseProfiles>release</releaseProfiles>
						<autoVersionSubmodules>true</autoVersionSubmodules>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.8.1</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<version>3.2.0</version>
					<configuration>
						<archive>
							<manifest>
								<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
								<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
							</manifest>
							<manifestEntries>
								<Implementation-Version>${project.version}_${maven.build.timestamp}</Implementation-Version>
								<Project-buildArtifact>${project.artifactId}</Project-buildArtifact>
								<Project-buildVersion>${project.version}</Project-buildVersion>
								<Project-buildTimestamp>${maven.build.timestamp}</Project-buildTimestamp>
								<!--suppress UnresolvedMavenProperty -->
								<Project-buildNumber>${buildNumber}</Project-buildNumber>
								<Project-buildScmBranch>${scmBranch}</Project-buildScmBranch>
							</manifestEntries>
						</archive>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>buildnumber-maven-plugin</artifactId>
					<version>1.4</version>
					<executions>
						<execution>
							<phase>validate</phase>
							<goals>
								<goal>create</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<!-- Die commit id bei "git log -abbrev-commit" ist ebenfalls 7 Zeichen. -->
						<shortRevisionLength>7</shortRevisionLength>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.projectlombok</groupId>
					<artifactId>lombok-maven-plugin</artifactId>
					<version>1.18.10.0</version>
				</plugin>

				<!-- https://mvnrepository.com/artifact/io.fabric8/docker-maven-plugin -->
				<plugin>
					<groupId>io.fabric8</groupId>
					<artifactId>docker-maven-plugin</artifactId>
					<version>0.33.0</version>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<profiles>
		<profile>
			<id>release</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-deploy-plugin</artifactId>
						<version>2.8.2</version>
						<configuration>
							<deployAtEnd>true</deployAtEnd>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
						<version>1.6.8</version>
						<extensions>true</extensions>
						<configuration>
							<serverId>sonatype</serverId>
							<nexusUrl>https://oss.sonatype.org/</nexusUrl>
							<autoReleaseAfterClose>true</autoReleaseAfterClose>
						</configuration>
					</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-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>1.6</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>
								<configuration>
									<gpgArguments>
										<arg>--pinentry-mode</arg>
										<arg>loopback</arg>
									</gpgArguments>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<configuration>
							<source>8</source>
							<doclint>none</doclint>
						</configuration>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<phase>package</phase>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<distributionManagement>
		<repository>
			<id>sonatype</id>
			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
		</repository>
		<snapshotRepository>
			<id>sonatype</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
	</distributionManagement>
</project>
