<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>
    <groupId>com.kinde</groupId>
    <artifactId>kinde-parent-pom</artifactId>
    <version>2.2.0</version>
    <name>parent-project</name>
    <description>Kinde Java SDK</description>
    <packaging>pom</packaging>
    <url>https://kinde.com</url>
    <organization>
        <name>Kinde</name>
        <url>https://kinde.com/docs</url>
    </organization>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://github.com/kinde-oss/kinde-java-sdk/blob/main/LICENSE</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <developerConnection>scm:git:https://github.com/kinde-oss/kinde-java-sdk.git</developerConnection>
        <connection>scm:git:https://github.com/kinde-oss/kinde-java-sdk.git</connection>
        <url>https://github.com/kinde-oss/kinde-java-sdk.git</url>
        <tag>HEAD</tag>
    </scm>

    <developers>
        <developer>
            <id>kinde-engineering</id>
            <name>Kinde Engineering</name>
            <email>engineering at kinde.com</email>
            <roles>
                <role>Owner</role>
            </roles>
        </developer>
    </developers>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>
    </dependencies>


    <dependencyManagement>
        <dependencies>
            <!-- Jackson BOM for consistent versioning -->
            <dependency>
                <groupId>com.fasterxml.jackson</groupId>
                <artifactId>jackson-bom</artifactId>
                <version>2.20.0</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- https://mvnrepository.com/artifact/com.nimbusds/oauth2-oidc-sdk -->
            <dependency>
                <groupId>com.nimbusds</groupId>
                <artifactId>oauth2-oidc-sdk</artifactId>
                <version>11.28</version>
            </dependency>
            <dependency>
                <groupId>com.nimbusds</groupId>
                <artifactId>nimbus-jose-jwt</artifactId>
                <version>10.4.2</version>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.13.2</version>
                <scope>test</scope>
            </dependency>
            <!-- JUnit 5 API and Engine -->
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>5.13.4</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>5.13.4</version>
                <scope>test</scope>
            </dependency>

            <!-- Optional: For parameterized tests -->
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-params</artifactId>
                <version>5.13.4</version>
                <scope>test</scope>
            </dependency>

            <!-- Mockito (if you are using it for mocking) -->
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>5.19.0</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-junit-jupiter</artifactId>
                <version>5.19.0</version>
                <scope>test</scope>
            </dependency>


            <dependency>
                <groupId>com.google.inject</groupId>
                <artifactId>guice</artifactId>
                <!-- {version} can be 6.0.0, 7.0.0, etc. -->
                <version>7.0.0</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.google.guava</groupId>
                        <artifactId>guava</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>33.4.8-jre</version>
            </dependency>


            <!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>1.18.38</version>
                <scope>provided</scope>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>2.0.17</version>
            </dependency>
            <dependency>
                <groupId>io.github.cdimascio</groupId>
                <artifactId>dotenv-java</artifactId>
                <version>3.2.0</version>
            </dependency>
            <dependency>
                <groupId>org.wiremock</groupId>
                <artifactId>wiremock</artifactId>
                <version>3.13.1</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>jakarta.servlet</groupId>
                <artifactId>jakarta.servlet-api</artifactId>
                <version>6.1.0</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.kinde</groupId>
                <artifactId>kinde-core</artifactId>
                <version>2.2.0</version>
            </dependency>
            <dependency>
                <groupId>com.kinde</groupId>
                <artifactId>kinde-management</artifactId>
                <version>2.2.0</version>
            </dependency>
            <dependency>
                <groupId>com.kinde</groupId>
                <artifactId>kinde-j2ee</artifactId>
                <version>2.2.0</version>
            </dependency>
            <dependency>
                <groupId>com.kinde.spring</groupId>
                <artifactId>kinde-springboot-core</artifactId>
                <version>2.2.0</version>
            </dependency>
            
            <!-- Jackson dependencies with consistent versions -->
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>2.20.0</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>2.20</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>2.20.0</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.datatype</groupId>
                <artifactId>jackson-datatype-joda</artifactId>
                <version>2.20.0</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.datatype</groupId>
                <artifactId>jackson-datatype-jsr310</artifactId>
                <version>2.20.0</version>
            </dependency>
            
            <!-- Force latest Kotlin stdlib version to minimize security vulnerability -->
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib</artifactId>
                <version>2.2.10</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib-jdk8</artifactId>
                <version>2.2.10</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib-jdk7</artifactId>
                <version>2.2.10</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib-common</artifactId>
                <version>2.2.10</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <modules>
        <module>kinde-core</module>
        <module>kinde-management</module>
        <module>kinde-j2ee</module>
        <module>kinde-springboot</module>
        <module>kinde-test-utils</module>
        <module>playground/kinde-core-example</module>
        <module>playground/kinde-management-example</module>
        <module>playground/kinde-accounts-example</module>
        <module>playground/kinde-j2ee-app</module>
        <module>playground/kinde-springboot-starter-example</module>
        <module>playground/kinde-springboot-pkce-client-example</module>
        <module>playground/kinde-springboot-thymeleaf-full-example</module>
        <module>kinde-report-aggregate</module>
    </modules>

    <build>

        <pluginManagement>
            <plugins>
                <!-- Removed nexus-staging-maven-plugin as it's not needed for MCPS -->
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.14.0</version>
                <configuration>
                    <source>17</source>
                    <target>17</target>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                            <version>1.18.38</version> <!-- Use the version you need -->
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <id>empty-javadoc-jar</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <classifier>javadoc</classifier>
                            <classesDirectory>${basedir}/javadoc</classesDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- We must generate a -sources JAR file to publish on Maven Central -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.3.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.13</version>
                <executions>
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <includes>
                        <include>com/kinde/**</include>
                    </includes>
                    <excludes>
                        <exclude>com/google/inject/**/*.class</exclude>
                        <exclude>javax/inject/**/*.class</exclude>
                        <exclude>org/springframework/**/*.class</exclude>
                        <exclude>**/generated/**</exclude>
                        <exclude>**/thirdparty/**</exclude>
                        <exclude>**/openapitools/**</exclude>
                        <!-- Add more excludes if necessary -->
                    </excludes>
                </configuration>
            </plugin>


        </plugins>

    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.2.8</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <keyname>${gpg.keyname}</keyname>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.8.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <autoPublish>true</autoPublish>
                            <waitUntil>published</waitUntil>
                            <excludeArtifacts>
                                <excludeArtifact>kinde-core-example</excludeArtifact>
                                <excludeArtifact>kinde-j2ee-app</excludeArtifact>
                                <excludeArtifact>kinde-management-example</excludeArtifact>
                                <excludeArtifact>kinde-accounts-example</excludeArtifact> 
                                <excludeArtifact>kinde-springboot-pkce-client-example</excludeArtifact>
                                <excludeArtifact>kinde-springboot-starter-example</excludeArtifact>
                                <excludeArtifact>kinde-springboot-thymeleaf-full-example</excludeArtifact>
                                <excludeArtifact>springboot-pkce-client-example</excludeArtifact>
                                <excludeArtifact>springboot-thymeleaf-full-example</excludeArtifact>
                                <excludeArtifact>report</excludeArtifact>
                            </excludeArtifacts>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
