<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2010-2023. Axon Framework
  ~
  ~ 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/xsd/maven-4.0.0.xsd">

    <groupId>org.axonframework.extensions.mongo</groupId>
    <artifactId>axon-mongo-parent</artifactId>
    <version>4.9.0</version>
    <modules>
        <module>mongo</module>
        <module>mongo-axon-example</module>
        <module>axon-mongo-spring</module>
        <module>axon-mongo-spring-boot-autoconfigure</module>
        <module>axon-mongo-spring-boot-starter</module>
    </modules>
    <packaging>pom</packaging>

    <modelVersion>4.0.0</modelVersion>

    <name>Axon Framework - Mongo Extension</name>
    <description>An Axon Framework extension providing Mongo integration.</description>

    <inceptionYear>2010</inceptionYear>
    <url>https://axoniq.io/</url>
    <licenses>
        <license>
            <name>Apache 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>
    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/AxonFramework/extension-mongo/issues</url>
    </issueManagement>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <!-- Main -->
        <axon.version>4.9.0</axon.version>
        <mongo.driver.version>4.11.0</mongo.driver.version>
        <!-- Logging -->
        <slf4j.version>2.0.9</slf4j.version>
        <log4j.version>2.21.1</log4j.version>
        <!-- Serialization -->
        <jackson.version>2.14.1</jackson.version>
        <!-- Spring -->
        <spring.version>5.3.30</spring.version>
        <spring.boot.version>2.7.17</spring.boot.version>
        <spring.data.mongodb.version>3.4.17</spring.data.mongodb.version>
        <!-- Other -->
        <commons-io.version>2.14.0</commons-io.version>
        <javax.inject.version>1</javax.inject.version>
        <javax.jaxb-api.version>2.3.1</javax.jaxb-api.version>
        <findbugs-jsr305.version>3.0.2</findbugs-jsr305.version>
        <!-- Testing -->
        <awaitility.version>4.2.0</awaitility.version>
        <junit.jupiter.version>5.9.1</junit.jupiter.version>
        <mockito.version>4.11.0</mockito.version>
        <testcontainers.version>1.19.1</testcontainers.version>
        <!-- Build / Plugins -->
        <jacoco-maven.version>0.8.10</jacoco-maven.version>
        <maven-assembly.version>3.6.0</maven-assembly.version>
        <maven-clean.version>3.3.1</maven-clean.version>
        <maven-compiler.version>3.11.0</maven-compiler.version>
        <maven-deploy.version>3.0.0</maven-deploy.version>
        <maven-enforcer.version>3.4.1</maven-enforcer.version>
        <maven-gpg.version>3.1.0</maven-gpg.version>
        <maven-install.version>3.1.1</maven-install.version>
        <maven-jar.version>3.3.0</maven-jar.version>
        <maven-javadoc.version>3.6.0</maven-javadoc.version>
        <maven-release.version>3.0.1</maven-release.version>
        <maven-source.version>3.3.0</maven-source.version>
        <maven-surefire.version>3.2.1</maven-surefire.version>
        <maven-resources.version>3.3.1</maven-resources.version>
    </properties>

    <dependencies>
        <!-- Testing -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>mongodb</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${spring.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jul-to-slf4j</artifactId>
            <version>${slf4j.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <version>${slf4j.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j-impl</artifactId>
            <version>${log4j.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>${log4j.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>com.sun.jdmk</groupId>
                    <artifactId>jmxtools</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.jmx</groupId>
                    <artifactId>jmxri</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.mail</groupId>
                    <artifactId>mail</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.jms</groupId>
                    <artifactId>jms</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- Other-->
        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <!-- Not pat of Java 9 by default. Adding it as a dependency makes it compatible with Java 8 -->
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <!-- Testing -->
            <dependency>
                <groupId>org.awaitility</groupId>
                <artifactId>awaitility</artifactId>
                <version>${awaitility.version}</version>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter</artifactId>
                <version>${junit.jupiter.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-junit-jupiter</artifactId>
                <version>${mockito.version}</version>
            </dependency>
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>testcontainers-bom</artifactId>
                <version>${testcontainers.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- Spring -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot</artifactId>
                <version>${spring.boot.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-autoconfigure-processor</artifactId>
                <version>${spring.boot.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.data</groupId>
                <artifactId>spring-data-mongodb</artifactId>
                <version>${spring.data.mongodb.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-test</artifactId>
                <version>${spring.boot.version}</version>
            </dependency>
            <!-- Other -->
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons-io.version}</version>
            </dependency>
            <dependency>
                <groupId>javax.inject</groupId>
                <artifactId>javax.inject</artifactId>
                <version>${javax.inject.version}</version>
            </dependency>
            <dependency>
                <groupId>javax.xml.bind</groupId>
                <artifactId>jaxb-api</artifactId>
                <version>${javax.jaxb-api.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>${maven-clean.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>${maven-install.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco-maven.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <!-- compile -->
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler.version}</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <!-- test -->
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <includes>
                        <include>**/*Test.java</include>
                        <include>**/*Tests.java</include>
                        <include>**/*Test_*.java</include>
                        <include>**/*Tests_*.java</include>
                    </includes>
                    <systemPropertyVariables>
                        <slf4j.version>${slf4j.version}</slf4j.version>
                        <log4j.version>${log4j.version}</log4j.version>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <!-- package -->
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>${maven-assembly.version}</version>
                <configuration>
                    <descriptorSourceDirectory>assembly</descriptorSourceDirectory>
                    <archiverConfig>
                        <duplicateBehavior>skip</duplicateBehavior>
                    </archiverConfig>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven-jar.version}</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc.version}</version>
                <executions>
                    <execution>
                        <id>attach-javadoc</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <doclint>none</doclint>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven-source.version}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- deploy -->
            <plugin>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>${maven-deploy.version}</version>
            </plugin>
            <plugin>
                <!-- just to make sure deployed artifacts are always built (and tested) using JDK 8+ -->
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven-enforcer.version}</version>
                <executions>
                    <execution>
                        <id>enforce-java</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <version>1.8</version>
                                </requireJavaVersion>
                                <requireMavenVersion>
                                    <version>3.5</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <version>${maven-release.version}</version>
                <configuration>
                    <mavenExecutorId>forked-path</mavenExecutorId>
                    <localCheckout>true</localCheckout>
                    <pushChanges>false</pushChanges>
                    <releaseProfiles>release-sign-artifacts</releaseProfiles>
                    <tagNameFormat>axon-mongo-@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>${maven-resources.version}</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>coverage</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>report</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>coverage-aggregate</id>
            <build>
                <defaultGoal>verify</defaultGoal>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <skipTests>true</skipTests>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <modules>
                <module>coverage-report</module>
            </modules>
        </profile>

        <profile>
            <id>java17-modules</id>
            <activation>
                <jdk>[17,)</jdk>
            </activation>
            <modules>
                <module>mongo-spring-boot-3-integrationtests</module>
            </modules>
        </profile>

        <profile>
            <id>release-sign-artifacts</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.1.0</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <!-- Suppress MavenModelInspection -->
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <repositories>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
                <checksumPolicy>fail</checksumPolicy>
            </snapshots>
        </repository>
    </repositories>

    <!-- Deploy and release configuration -->
    <distributionManagement>
        <snapshotRepository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <uniqueVersion>true</uniqueVersion>
        </snapshotRepository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
            <uniqueVersion>false</uniqueVersion>
        </repository>
    </distributionManagement>

    <scm>
        <connection>scm:git:git://github.com/AxonFramework/extension-mongo.git</connection>
        <developerConnection>scm:git:git@github.com:AxonFramework/extension-mongo.git</developerConnection>
        <url>https://github.com/AxonFramework/extension-mongo</url>
        <tag>axon-mongo-4.9.0</tag>
    </scm>

    <developers>
        <developer>
            <name>Allard Buijze</name>
            <email>allard.buijze@axoniq.io</email>
            <organization>AxonIQ</organization>
            <organizationUrl>https://axoniq.io</organizationUrl>
            <roles>
                <role>Project Owner</role>
            </roles>
        </developer>
        <developer>
            <name>Steven van Beelen</name>
            <email>steven.vanbeelen@axoniq.io</email>
            <organization>AxonIQ</organization>
            <organizationUrl>https://axoniq.io</organizationUrl>
            <roles>
                <role>Lead Developer</role>
            </roles>
        </developer>
        <developer>
            <name>Gerard Klijs</name>
            <email>gerard.klijs@axoniq.io</email>
            <organization>AxonIQ</organization>
            <organizationUrl>https://axoniq.io</organizationUrl>
            <roles>
                <role>Developer</role>
            </roles>
        </developer>
        <developer>
            <name>Mitchell Herrijgers</name>
            <email>mitchell.herrijgers@axoniq.io</email>
            <organization>AxonIQ</organization>
            <organizationUrl>https://axoniq.io</organizationUrl>
            <roles>
                <role>Developer</role>
            </roles>
        </developer>
    </developers>
</project>
