<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>org.entur.jwt-rs</groupId>
	<artifactId>parent</artifactId>
	<version>4.1.3</version>
	<packaging>pom</packaging>
	<name>JWT Resource Server</name>
	<description>Json Web Token resource-server utilities</description>
	<url>https://github.com/entur/jwt-resource-server</url>

	<organization>
		<name>Entur AS</name>
		<url>https://www.entur.org/</url>
	</organization>

	<licenses>
		<license>
			<name>EUPL-1.2 with modifications</name>
			<url>https://joinup.ec.europa.eu/software/page/eupl</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<developers>
		<developer>
			<name>Thomas Skjølberg</name>
			<email>thomas.rorvik.skjolberg@entur.org</email>
			<organization>Entur</organization>
			<organizationUrl>https://www.entur.org</organizationUrl>
		</developer>
	</developers>

	<scm>
		<connection>scm:git:git@github.com:entur/jwt-resource-server.git</connection>
		<developerConnection>scm:git:git@github.com:entur/jwt-resource-server.git</developerConnection>
		<url>git@github.com:entur/jwt-resource-server.git</url>
		<tag>parent-4.1.3</tag>
	</scm>

	<issueManagement>
		<system>GitHub</system>
		<url>https://github.com/entur/jwt-resource-server/issues</url>
	</issueManagement>

	<ciManagement>
		<system>Github Actions</system>
		<url>https://github.com/entur/jwt-resource-server/actions</url>
	</ciManagement>

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

		<maven.compiler.source>17</maven.compiler.source>
		<maven.compiler.target>17</maven.compiler.target>

		<commons-io.version>2.15.1</commons-io.version>
		<google-truth.version>1.2.0</google-truth.version>
		<junit.version>5.10.1</junit.version>
		<mockito.version>5.8.0</mockito.version>
		<hamcrest.version>2.2</hamcrest.version>
		<slf4j.version>2.0.9</slf4j.version>
		<jjwt.version>0.12.3</jjwt.version>
		<nimbus-jose-jwt.version>9.37.2</nimbus-jose-jwt.version>
		<jackson-databind.version>2.16.1</jackson-databind.version>
		<jadler.version>1.3.1</jadler.version>
		<spring-boot.version>3.2.2</spring-boot.version>
		<httpclient.version>5.2.3</httpclient.version>
		<!-- added due to security issue -->
		<spring-security.version>6.2.1</spring-security.version>
		<spring.version>6.1.3</spring.version>
		<rest-assured.version>5.3.2</rest-assured.version>
		<okhttp.version>4.12.0</okhttp.version>
		<reactor-netty-http.version>1.1.15</reactor-netty-http.version>

		<grpc.version>1.61.0</grpc.version>
		<proto.version>3.25.2</proto.version>
		<lognet.version>5.1.5</lognet.version>
		<!-- https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-dependencies  -->
		<!-- transient dependencies added due to security patching -->
		<tomcat.version>10.1.18</tomcat.version>
		<netty.version>4.1.104.Final</netty.version>

		<json-smart.version>2.5.0</json-smart.version>

		<!-- plugins -->
		<build-helper-maven-plugin.version>1.9.1</build-helper-maven-plugin.version>
		<jacoco-maven-plugin.version>0.8.11</jacoco-maven-plugin.version>
		<nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
		<maven-surefire-plugin.version>3.2.3</maven-surefire-plugin.version>
		<maven-source-plugin.version>3.3.0</maven-source-plugin.version>
		<maven-javadoc-plugin.version>3.6.3</maven-javadoc-plugin.version>
		<maven-release-plugin.version>3.0.1</maven-release-plugin.version>
		<maven-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>
		<maven-dependency-plugin.version>3.6.1</maven-dependency-plugin.version>
		<maven-compiler-plugin.version>3.12.1</maven-compiler-plugin.version>
		<maven-shade-plugin.version>3.1.1</maven-shade-plugin.version>
		<maven-war-plugin.version>3.2.2</maven-war-plugin.version>
		<owasp-dependency-check.version>9.0.7</owasp-dependency-check.version>

		<distribution-respository-id>ossrh</distribution-respository-id>

		<os-maven-plugin.version>1.7.1</os-maven-plugin.version>
		<protobuf-maven-plugin.version>0.6.1</protobuf-maven-plugin.version>
	</properties>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>${project.groupId}</groupId>
				<artifactId>jwt-junit5-core</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>${project.groupId}</groupId>
				<artifactId>jwt-core</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>${project.groupId}</groupId>
				<artifactId>jwt-client-core</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>${project.groupId}</groupId>
				<artifactId>jwt-client-spring</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>${project.groupId}</groupId>
				<artifactId>jwt-client-spring-core</artifactId>
				<version>${project.version}</version>
			</dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>jwt-spring-common</artifactId>
                <version>${project.version}</version>
            </dependency>
			<dependency>
				<groupId>${project.groupId}</groupId>
				<artifactId>jwt-spring-web</artifactId>
				<version>${project.version}</version>
			</dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>jwt-spring-webflux</artifactId>
                <version>${project.version}</version>
            </dependency>
			<dependency>
				<groupId>${project.groupId}</groupId>
				<artifactId>jwt-junit5-entur</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>${project.groupId}</groupId>
				<artifactId>jwt-junit5-spring</artifactId>
				<version>${project.version}</version>
			</dependency>
			<!-- third party dependencies -->
			<dependency>
				<groupId>io.grpc</groupId>
				<artifactId>grpc-bom</artifactId>
				<version>${grpc.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<dependency>
				<groupId>org.springframework.security</groupId>
				<artifactId>spring-security-bom</artifactId>
				<version>${spring-security.version}</version>
				<scope>import</scope>
				<type>pom</type>
			</dependency>

			<dependency>
				<groupId>io.netty</groupId>
				<artifactId>netty-bom</artifactId>
				<version>${netty.version}</version>
				<scope>import</scope>
				<type>pom</type>
			</dependency>

			<dependency>
				<groupId>io.jsonwebtoken</groupId>
				<artifactId>jjwt-api</artifactId>
				<version>${jjwt.version}</version>
			</dependency>
			<dependency>
				<groupId>io.jsonwebtoken</groupId>
				<artifactId>jjwt-impl</artifactId>
				<version>${jjwt.version}</version>
				<scope>runtime</scope>
			</dependency>
			<dependency>
				<groupId>io.jsonwebtoken</groupId>
				<artifactId>jjwt-jackson</artifactId>
				<version>${jjwt.version}</version>
				<scope>runtime</scope>
			</dependency>
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-api</artifactId>
				<version>${slf4j.version}</version>
			</dependency>
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-simple</artifactId>
				<version>${slf4j.version}</version>
			</dependency>
			<dependency>
				<groupId>com.auth0</groupId>
				<artifactId>java-jwt</artifactId>
				<version>${java-jwt.version}</version>
			</dependency>
			<dependency>
				<groupId>com.nimbusds</groupId>
				<artifactId>nimbus-jose-jwt</artifactId>
				<version>${nimbus-jose-jwt.version}</version>
			</dependency>
			<dependency>
				<groupId>com.github.vladimir-bukhtoyarov</groupId>
				<artifactId>bucket4j-core</artifactId>
				<version>${bucket4j-core.version}</version>
			</dependency>
			<dependency>
				<groupId>com.fasterxml.jackson.core</groupId>
				<artifactId>jackson-databind</artifactId>
				<version>${jackson-databind.version}</version>
			</dependency>
			<dependency>
				<groupId>com.fasterxml.jackson.dataformat</groupId>
				<artifactId>jackson-dataformat-properties</artifactId>
				<version>${jackson-databind.version}</version>
			</dependency>

			<!-- need spring-web, but then we need to define the rest too, due to spring boot starter security -->
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-web</artifactId>
				<version>${spring.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-webmvc</artifactId>
				<version>${spring.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-aop</artifactId>
				<version>${spring.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-beans</artifactId>
				<version>${spring.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-core</artifactId>
				<version>${spring.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-context</artifactId>
				<version>${spring.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-expression</artifactId>
				<version>${spring.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-webflux</artifactId>
				<version>${spring.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-test</artifactId>
				<version>${spring.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-tx</artifactId>
				<version>${spring.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-autoconfigure</artifactId>
				<version>${spring-boot.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-configuration-processor</artifactId>
				<version>${spring-boot.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-starter</artifactId>
				<version>${spring-boot.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-starter-actuator</artifactId>
				<version>${spring-boot.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-starter-web</artifactId>
				<version>${spring-boot.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-starter-webflux</artifactId>
				<version>${spring-boot.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-starter-test</artifactId>
				<version>${spring-boot.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-starter-security</artifactId>
				<version>${spring-boot.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
				<version>${spring-boot.version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.tomcat.embed</groupId>
				<artifactId>tomcat-embed-core</artifactId>
				<version>${tomcat.version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.tomcat.embed</groupId>
				<artifactId>tomcat-embed-el</artifactId>
				<version>${tomcat.version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.tomcat.embed</groupId>
				<artifactId>tomcat-embed-websocket</artifactId>
				<version>${tomcat.version}</version>
			</dependency>

			<dependency>
				<groupId>io.projectreactor.netty</groupId>
				<artifactId>reactor-netty-http</artifactId>
				<version>${reactor-netty-http.version}</version>
			</dependency>

			<dependency>
				<groupId>org.apache.httpcomponents.client5</groupId>
				<artifactId>httpclient5</artifactId>
				<version>${httpclient.version}</version>
				<exclusions>
					<exclusion>
						<groupId>commons-logging</groupId>
						<artifactId>commons-logging</artifactId>
					</exclusion>
				</exclusions>
			</dependency>

			<!-- test dependencies -->
			<dependency>
				<groupId>commons-io</groupId>
				<artifactId>commons-io</artifactId>
				<version>${commons-io.version}</version>
			</dependency>
			<dependency>
				<groupId>org.junit</groupId>
				<artifactId>junit-bom</artifactId>
				<version>${junit.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<dependency>
				<groupId>com.google.truth</groupId>
				<artifactId>truth</artifactId>
				<version>${google-truth.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>com.google.truth.extensions</groupId>
				<artifactId>truth-java8-extension</artifactId>
				<version>${google-truth.version}</version>
			</dependency>
			<dependency>
				<groupId>org.mockito</groupId>
				<artifactId>mockito-core</artifactId>
				<version>${mockito.version}</version>
			</dependency>
			<dependency>
				<groupId>org.hamcrest</groupId>
				<artifactId>hamcrest</artifactId>
				<version>${hamcrest.version}</version>
			</dependency>
			<dependency>
				<groupId>net.jadler</groupId>
				<artifactId>jadler-all</artifactId>
				<version>${jadler.version}</version>
			</dependency>
			<dependency>
				<groupId>io.rest-assured</groupId>
				<artifactId>rest-assured</artifactId>
				<version>${rest-assured.version}</version>
			</dependency>
			<dependency>
				<groupId>com.squareup.okhttp3</groupId>
				<artifactId>mockwebserver</artifactId>
				<version>${okhttp.version}</version>
			</dependency>
			<dependency>
				<groupId>com.squareup.okhttp3</groupId>
				<artifactId>okhttp</artifactId>
				<version>${okhttp.version}</version>
			</dependency>
		</dependencies>
	</dependencyManagement>
	<build>
		<defaultGoal>clean test</defaultGoal>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>${maven-compiler-plugin.version}</version>
			</plugin>
			<!-- https://junit.org/junit5/docs/current/user-guide/#running-tests-build-maven -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>${maven-surefire-plugin.version}</version>
				<configuration>
					<excludes>
						<exclude />
					</excludes>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<version>${maven-surefire-plugin.version}</version>
			</plugin>
			<plugin>
				<groupId>org.sonatype.plugins</groupId>
				<artifactId>nexus-staging-maven-plugin</artifactId>
				<version>${nexus-staging-maven-plugin.version}</version>
				<extensions>true</extensions>
				<executions>
					<execution>
						<id>default-deploy</id>
						<phase>deploy</phase>
						<goals>
							<goal>deploy</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<serverId>ossrh</serverId>
					<nexusUrl>https://oss.sonatype.org/</nexusUrl>
					<autoReleaseAfterClose>false</autoReleaseAfterClose>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>${maven-source-plugin.version}</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-javadoc-plugin</artifactId>
				<version>${maven-javadoc-plugin.version}</version>
				<configuration>
					<source>17</source>
					<detectJavaApiLink>false</detectJavaApiLink>
				</configuration>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<version>${maven-release-plugin.version}</version>
				<configuration>
					<autoVersionSubmodules>true</autoVersionSubmodules>
					<useReleaseProfile>false</useReleaseProfile>
					<releaseProfiles>release</releaseProfiles>
					<goals>deploy</goals>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>${jacoco-maven-plugin.version}</version>
				<executions>
					<execution>
						<id>prepare-agent</id>
						<phase>initialize</phase>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
					</execution>
					<execution>
						<id>report</id>
						<goals>
							<goal>report-aggregate</goal>
						</goals>
						<phase>verify</phase>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.owasp</groupId>
				<artifactId>dependency-check-maven</artifactId>
				<version>${owasp-dependency-check.version}</version>
				<configuration>
					<failBuildOnCVSS>7</failBuildOnCVSS>
					<failOnError>false</failOnError>
					<skipTestScope>true</skipTestScope>
					<!-- suppressionFiles: see https://jeremylong.github.io/DependencyCheck/general/suppression.html -->
					<suppressionFiles>
						<suppressionFile>${maven.multiModuleProjectDirectory}/dependencycheck-root-suppression.xml</suppressionFile>
					</suppressionFiles>
					<nvdApiKey>${NVD_API_KEY}</nvdApiKey>
				</configuration>

				<executions>
					<execution>
						<!-- run only using explicit command -->
						<phase>none</phase>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>com.github.spotbugs</groupId>
				<artifactId>spotbugs-maven-plugin</artifactId>
				<version>3.1.12.2</version>
			</plugin>
			<plugin>
				<groupId>net.revelc.code.formatter</groupId>
				<artifactId>formatter-maven-plugin</artifactId>
				<version>2.11.0</version>
				<configuration>
					<configFile>${maven.multiModuleProjectDirectory}/.eclipse-formatter-config.xml</configFile>
				</configuration>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.sonarsource.scanner.maven</groupId>
					<artifactId>sonar-maven-plugin</artifactId>
					<version>3.7.0.1746</version>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<profiles>
		<profile>
			<id>examples</id>
			<activation>
				<!-- i.e. not active for release -->
				<activeByDefault>true</activeByDefault>
			</activation>
			<modules>
				<module>examples/jwt-resource-server-spring-boot-example</module>
				<module>examples/jwt-client-spring-boot-example</module>
			</modules>
		</profile>
		<profile>
			<id>snapshot</id>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>
		</profile>
		<profile>
			<!-- mvn -P release release:perform -->
			<id>release</id>
			<properties>
				<!-- this is useful when the desired key is not the default (first) export
					GPG_KEY_NAME=ABCDEF01 -->
				<gpg.executable>gpg</gpg.executable>
				<gpg.keyname>${env.GPG_KEY_NAME}</gpg.keyname>
			</properties>
			<build>
				<plugins>
					<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>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<modules>
		<module>jwt-test/jwt-junit5-core</module>
		<module>jwt-test/jwt-junit5-entur</module>
		<module>jwt-test/jwt-junit5-spring</module>
		<module>jwt-client/jwt-client-core</module>
		<module>jwt-client/jwt-client-spring-core</module>
		<module>jwt-client/jwt-client-spring</module>
		<module>jwt-client/jwt-client-spring-webflux</module>
        <module>jwt-server/spring/jwt-spring-web</module>
        <module>jwt-server/spring/jwt-spring-common</module>
		<module>jwt-server/spring/jwt-spring-webflux</module>
		<module>jwt-server/spring/jwt-spring-grpc</module>
		<module>jwt-bom</module>
	</modules>

	<distributionManagement>
		<!-- Pass in -Ddistribution-respository-id=myServeId for custom credentials -->
		<snapshotRepository>
			<id>${distribution-respository-id}</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
		<repository>
			<id>${distribution-respository-id}</id>
			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
	</distributionManagement>

</project>
