<!--
  ~ Copyright 2017 Okta, Inc.
  ~
  ~ 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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.okta</groupId>
        <artifactId>okta-parent</artifactId>
        <version>38</version>
        <relativePath>../okta-java-parent/parent</relativePath>
    </parent>

    <groupId>com.okta.spring</groupId>
    <artifactId>okta-spring-boot-parent</artifactId>
    <version>3.1.0</version>
    <name>Okta Spring Boot</name>
    <packaging>pom</packaging>

    <properties>
        <spring-boot.version>4.0.1</spring-boot.version>
        <spring-cloud.version>4.2.0</spring-cloud.version>
        <github.slug>okta/okta-spring-boot</github.slug>
        <okta.sdk.version>24.0.0</okta.sdk.version>
        <okta.commons.version>2.0.2</okta.commons.version>
        <!-- Spring Boot 4.x requires Java 17+ -->
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <maven.compiler.release>17</maven.compiler.release>
    </properties>

    <modules>
        <module>oauth2</module>
        <module>sdk</module>
        <module>okta-spring-boot-starter</module>
        <module>integration-tests/common-reactive</module>
        <module>integration-tests/common-servlet</module>
        <module>integration-tests/oauth2-reactive</module>
        <module>integration-tests/oauth2-reactive-spring</module>
        <module>integration-tests/oauth2-servlet</module>
        <module>integration-tests/oauth2-servlet-spring</module>
        <module>examples</module>
        <module>coverage</module>
    </modules>

    <dependencyManagement>
        <dependencies>

            <dependency>
                <groupId>io.rest-assured</groupId>
                <artifactId>rest-assured-bom</artifactId>
                <version>5.5.5</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <!-- Import dependency management from Spring Boot -->
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- this project's modules -->
            <dependency>
                <groupId>com.okta.spring</groupId>
                <artifactId>okta-spring-boot-starter</artifactId>
                <version>3.1.0</version>
            </dependency>
            <dependency>
                <groupId>com.okta.spring</groupId>
                <artifactId>okta-spring-security-oauth2</artifactId>
                <version>3.1.0</version>
            </dependency>

            <dependency>
                <groupId>com.okta.spring</groupId>
                <artifactId>okta-spring-sdk</artifactId>
                <version>3.1.0</version>
            </dependency>
            <dependency>
                <groupId>com.okta.spring</groupId>
                <artifactId>okta-spring-boot-integration-tests-common-servlet</artifactId>
                <version>3.1.0</version>
            </dependency>
            <dependency>
                <groupId>com.okta.spring</groupId>
                <artifactId>okta-spring-boot-integration-tests-common-servlet</artifactId>
                <version>3.1.0</version>
                <classifier>tests</classifier>
                <type>test-jar</type>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.okta.spring</groupId>
                <artifactId>okta-spring-boot-integration-tests-common-reactive</artifactId>
                <version>3.1.0</version>
            </dependency>
            <dependency>
                <groupId>com.okta.spring</groupId>
                <artifactId>okta-spring-boot-integration-tests-common-reactive</artifactId>
                <version>3.1.0</version>
                <classifier>tests</classifier>
                <type>test-jar</type>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>com.okta.sdk</groupId>
                <artifactId>okta-sdk-api</artifactId>
                <version>${okta.sdk.version}</version>
            </dependency>
            <dependency>
                <groupId>com.okta.sdk</groupId>
                <artifactId>okta-sdk-impl</artifactId>
                <version>${okta.sdk.version}</version>
            </dependency>
            <dependency>
                <groupId>com.okta.sdk</groupId>
                <artifactId>okta-sdk-httpclient</artifactId>
                <version>8.2.5</version>
            </dependency>
            <dependency>
                <groupId>com.okta.commons</groupId>
                <artifactId>okta-config-check</artifactId>
                <version>${okta.commons.version}</version>
            </dependency>
            <dependency>
                <groupId>com.okta.commons</groupId>
                <artifactId>okta-commons-lang</artifactId>
                <version>${okta.commons.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>2.0.17</version>
            </dependency>
            <dependency>
                <groupId>com.okta.oidc.tck</groupId>
                <artifactId>okta-oidc-tck</artifactId>
                <version>0.5.10</version>
            </dependency>
            <dependency>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcprov-jdk18on</artifactId>
                <version>1.81</version>
            </dependency>
            <dependency>
                <groupId>com.nimbusds</groupId>
                <artifactId>nimbus-jose-jwt</artifactId>
                <version>10.3.1</version>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents.client5</groupId>
                <artifactId>httpclient5</artifactId>
                <version>5.5</version>
            </dependency>

            <!-- test dependencies -->
            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>7.11.0</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.github.tomakehurst</groupId>
                <artifactId>wiremock-standalone</artifactId>
                <version>3.0.0-beta-7</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>io.rest-assured</groupId>
                <artifactId>rest-assured-all</artifactId>
                <version>5.5.5</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>5.18.0</version>
            </dependency>
            <dependency>
                <groupId>org.yaml</groupId>
                <artifactId>snakeyaml</artifactId>
                <version>2.4</version>
            </dependency>
            <dependency>
                <groupId>net.minidev</groupId>
                <artifactId>json-smart</artifactId>
                <version>2.5.2</version>
            </dependency>
            <dependency>
                <groupId>com.jayway.jsonpath</groupId>
                <artifactId>json-path</artifactId>
                <version>2.9.0</version>
            </dependency>
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-handler</artifactId>
                <version>4.2.6.Final</version>
            </dependency>
            <dependency>
                <groupId>org.apache.tomcat.embed</groupId>
                <artifactId>tomcat-embed-core</artifactId>
                <version>11.0.12</version>
            </dependency>
            <dependency>
                <groupId>org.apache.tomcat.embed</groupId>
                <artifactId>tomcat-embed-websocket</artifactId>
                <version>11.0.12</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>3.18.0</version>
            </dependency>
            <dependency>
                <groupId>org.codehaus.plexus</groupId>
                <artifactId>plexus-utils</artifactId>
                <version>4.0.2</version>
            </dependency>
            
            <!-- Exclude commons-logging to avoid banned dependency issue in Spring Boot 4.x -->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>7.0.2</version>
                <exclusions>
                    <exclusion>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
       <plugins>
           <plugin>
               <groupId>org.owasp</groupId>
               <artifactId>dependency-check-maven</artifactId>
               <configuration>
                   <ossIndexUsername>${env.OSS_EMAIL}</ossIndexUsername> <!-- the account's email -->
                   <ossIndexPassword>${env.OSS_TOKEN}</ossIndexPassword>
               </configuration>
           </plugin>
           <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-release-plugin</artifactId>
               <version>3.1.1</version>
               <configuration>
                   <localCheckout>true</localCheckout>
               </configuration>
           </plugin>
       </plugins>
       <pluginManagement>
          <plugins>
              <plugin>
                  <groupId>org.owasp</groupId>
                  <artifactId>dependency-check-maven</artifactId>
                  <configuration>
                      <skip>true</skip>
                      <ossIndexServerId>sonatype-oss-index</ossIndexServerId>
                  </configuration>
              </plugin>
              <plugin>
                  <groupId>org.sonatype.central</groupId>
                  <artifactId>central-publishing-maven-plugin</artifactId>
                  <version>0.6.0</version>
                  <extensions>true</extensions>
                  <configuration>
                      <publishingServerId>central-sonatype-upload</publishingServerId>
                  </configuration>
              </plugin>
          </plugins>
       </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>3.5.3</version>
                        <configuration>
                            <forkCount>0</forkCount>
                            <reuseForks>false</reuseForks>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>spring-milestone</id>
            <repositories>
                <repository>
                    <id>repository.spring.milestone</id>
                    <name>Spring Milestone Repository</name>
                    <url>https://repo.spring.io/milestone</url>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>repository.spring.milestone</id>
                    <name>Spring Milestone Repository</name>
                    <url>https://repo.spring.io/milestone</url>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
    </profiles>

  <scm>
    <tag>okta-spring-boot-parent-3.1.0</tag>
  </scm>
</project>
