<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.ontimize.jee.sdms</groupId>
    <artifactId>ontimize-jee-sdms</artifactId>
    <version>1.3.1</version>
    <packaging>pom</packaging>
    <name>Ontimize EE SDMS</name>
    <description>Ontimize EE Storage DMS (SDMS) is a system for storing and managing files by entity.</description>
    <url>https://www.ontimize.com</url>

    <parent>
        <groupId>com.ontimize.jee</groupId>
        <artifactId>ontimize-jee</artifactId>
        <version>5.7.0</version>
    </parent>

    <organization>
        <name>Imatia Innovation</name>
        <url>http://imatia.com</url>
    </organization>

    <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>Ángel Herce Soto</name>
            <email>angel.herce@imatia.com</email>
            <organization>Imatia Innovation</organization>
            <organizationUrl>http://imatia.com</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/ontimize/ontimize-jee-sdms.git</connection>
        <developerConnection>scm:git:ssh://github.com/ontimize/ontimize-jee-sdms.git</developerConnection>
        <url>https://github.com/ontimize/ontimize-jee-sdms.git/tree/main</url>
    </scm>

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

    <modules>
        <module>ontimize-jee-sdms-common</module>
        <module>ontimize-jee-sdms-event</module>
        <module>ontimize-jee-sdms-server</module>
        <module>ontimize-jee-sdms-engine</module>
        <module>ontimize-jee-sdms-rest</module>
    </modules>

    <properties>
        <!-- JAVA -->
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>

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

        <!-- DEPENDENCIES -->
        <ontimize-jee.version>5.7.0</ontimize-jee.version>
        <reflections.version>0.10.2</reflections.version>
        <amazonaws.version>1.12.382</amazonaws.version>
        <junit.version>5.9.3</junit.version>
        <mockito.version>5.4.0</mockito.version>

        <!-- PLUGINS -->
        <compiler.plugin.version>3.8.1</compiler.plugin.version>
        <dependency-maven-plugin.version>1.0</dependency-maven-plugin.version>
        <deploy.plugin.version>3.0.0-M1</deploy.plugin.version>
        <ear.plugin.version>2.8</ear.plugin.version>
        <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
        <maven-jar-plugin.version>3.0.2</maven-jar-plugin.version>
        <maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version>
        <nexus-staging-maven-plugin.version>1.6.7</nexus-staging-maven-plugin.version>
        <resources.plugin.version>3.2.0</resources.plugin.version>
        <source.plugin.version>3.2.1</source.plugin.version>
        <war.plugin.version>2.4</war.plugin.version>
        <maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
        <maven-failsafe-plugin.version>3.0.0-M5</maven-failsafe-plugin.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- MODULES -->
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>ontimize-jee-sdms-common</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>ontimize-jee-sdms-event</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>ontimize-jee-sdms-server</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>ontimize-jee-sdms-engine-s3</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>ontimize-jee-sdms-rest</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- ONTIMIZE JEE -->
            <dependency>
                <groupId>com.ontimize.jee</groupId>
                <artifactId>ontimize-jee-common</artifactId>
                <version>${ontimize-jee.version}</version>
            </dependency>

            <dependency>
                <groupId>com.ontimize.jee</groupId>
                <artifactId>ontimize-jee-server</artifactId>
                <version>${ontimize-jee.version}</version>
            </dependency>

            <dependency>
                <groupId>com.ontimize.jee</groupId>
                <artifactId>ontimize-jee-server-rest</artifactId>
                <version>${ontimize-jee.version}</version>
            </dependency>

            <!-- REFLECTIONS -->
            <dependency>
                <groupId>org.reflections</groupId>
                <artifactId>reflections</artifactId>
                <version>${reflections.version}</version>
            </dependency>

            <!-- AMAZON AWS S3 -->
            <dependency>
                <groupId>com.amazonaws</groupId>
                <artifactId>aws-java-sdk-s3</artifactId>
                <version>${amazonaws.version}</version>
            </dependency>

            <!-- JUNIT -->
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>${junit.version}</version>
            </dependency>

            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-params</artifactId>
                <version>${junit.version}</version>
            </dependency>

            <!-- MOCKITO -->
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${deploy.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${source.plugin.version}</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <!-- dependency maven plugin -->
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>dependency-maven-plugin</artifactId>
                    <version>${dependency-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                            <configuration>
                                <failOnError>false</failOnError>
                                <doclint>none</doclint>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <!-- Maven junit test plugin -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>snapshot-repository</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <repositories>
                <repository>
                    <id>sonatype-snapshot</id>
                    <url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>
        </profile>
        <profile>
            <id>generate-version</id>
            <repositories>
                <repository>
                    <id>sonatype-snapshot</id>
                    <url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>
            <build>
                <plugins>
                    <!-- Source -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                    </plugin>
                    <!-- JavaDoc -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${nexus-staging-maven-plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    <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>
                                <configuration>
                                    <!-- Prevent gpg from using pinentry programs. Fixes: gpg: signing
                                        failed: Inappropriate ioctl for device -->
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                    <keyname>${gpg.keyname}</keyname>
                                    <passphraseServerId>${gpg.keyname}</passphraseServerId>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>