<?xml version="1.0" encoding="UTF-8"?>
<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>io.agrest</groupId>
    <artifactId>agrest-parent</artifactId>
    <version>5.0-RC2</version>

    <name>agrest: parent POM of all modules</name>
    <description>Agrest is a Model-driven RESTful data services framework. This is the parent POM of all Agrest
        modules
    </description>
    <packaging>pom</packaging>

    <modules>
        <module>agrest-annotations</module>
        <module>agrest-engine</module>
        <module>agrest-jaxrs3</module>
        <module>agrest-jaxrs3-openapi</module>
        <module>agrest-jaxrs2</module>
        <module>agrest-jaxrs2-openapi</module>
        <module>agrest-cayenne</module>
        <module>agrest-bom</module>
    </modules>

    <properties>

        <maven.compiler.release>11</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <!-- Upstream dependency versions (including "test" dependencies) -->
        <slf4j.version>2.0.17</slf4j.version>
        <cayenne.version>4.2.3</cayenne.version>

        <!-- JAX-RS 2 is deprecated -->
        <jaxrs2.version>2.1.6</jaxrs2.version>

        <jaxrs3.version>3.0.0</jaxrs3.version>
        <jackson.version>2.15.4</jackson.version>
        <jackson.databind.version>2.15.4</jackson.databind.version>
        <bq.version>3.0-RC1</bq.version>
        <junit5.version>5.12.1</junit5.version>
        <swagger.version>2.2.23</swagger.version>
        <mockito.version>3.9.0</mockito.version>

        <!-- Plugin Versions -->
        <compiler.plugin.version>3.14.0</compiler.plugin.version>
        <jar.plugin.version>3.4.2</jar.plugin.version>
        <javadoc.plugin.version>3.11.2</javadoc.plugin.version>
        <deploy.plugin.version>3.1.4</deploy.plugin.version>
        <source.plugin.version>3.3.1</source.plugin.version>
        <release.plugin.version>3.1.1</release.plugin.version>
        <surefire.plugin.version>3.5.2</surefire.plugin.version>
        <failsafe.plugin.version>3.5.2</failsafe.plugin.version>
        <central.publishing.plugin.version>0.7.0</central.publishing.plugin.version>
        <gpg.plugin.version>3.2.7</gpg.plugin.version>

        <!-- Misc -->
        <gpg.pinentry.mode>loopback</gpg.pinentry.mode>
    </properties>

    <url>https://github.com/agrestio/agrest/</url>

    <licenses>
        <license>
            <name>Apache 2.0 License</name>
            <url>https://github.com/agrestio/agrest/blob/master/LICENSE.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>


    <developers>
        <developer>
            <id>andrus</id>
            <name>Andrus Adamchik</name>
            <email>andrus@objectstyle.com</email>
            <organization>ObjectStyle</organization>
            <timezone>America/New_York</timezone>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:https://github.com/agrestio/agrest</connection>
        <developerConnection>scm:git:ssh://git@github.com/agrestio/agrest</developerConnection>
        <url>https://github.com/agrestio/agrest</url>
        <tag>agrest-parent-5.0-RC2</tag>
    </scm>

    <distributionManagement>
        <repository>
            <id>sonatype-central</id>
            <name>Sonatype Central Portal Repository</name>
        </repository>
        <!--
        default repo URLs are hardcoded in the `central-publishing-maven-plugin`
        for the snapshot repo it's https://central.sonatype.com/repository/maven-snapshots/
        -->
    </distributionManagement>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>${junit5.version}</version>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-params</artifactId>
                <version>${junit5.version}</version>
            </dependency>
            <!-- Use Vintage until we switch every module to JUnit 5-->
            <dependency>
                <groupId>org.junit.vintage</groupId>
                <artifactId>junit-vintage-engine</artifactId>
                <version>${junit5.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
            </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.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.jaxrs</groupId>
                <artifactId>jackson-jaxrs-json-provider</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.datatype</groupId>
                <artifactId>jackson-datatype-jsr310</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.dataformat</groupId>
                <artifactId>jackson-dataformat-yaml</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.jakarta.rs</groupId>
                <artifactId>jackson-jakarta-rs-json-provider</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.databind.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.cayenne</groupId>
                <artifactId>cayenne-di</artifactId>
                <version>${cayenne.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.cayenne</groupId>
                <artifactId>cayenne-server</artifactId>
                <version>${cayenne.version}</version>
            </dependency>
            <!--
            Importing individual Bootique modules instead of a BOM, as BOM would be treated as a dependency
            by the downstream projects.
            -->
            <dependency>
                <groupId>io.bootique.jdbc</groupId>
                <artifactId>bootique-jdbc-junit5-derby</artifactId>
                <version>${bq.version}</version>
            </dependency>
            <dependency>
                <groupId>io.bootique.cayenne</groupId>
                <artifactId>bootique-cayenne42-junit5</artifactId>
                <version>${bq.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.apache.cayenne</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>io.bootique</groupId>
                <artifactId>bootique-junit5</artifactId>
                <version>${bq.version}</version>
            </dependency>
            <dependency>
                <groupId>io.bootique.jersey</groupId>
                <artifactId>bootique-jersey</artifactId>
                <version>${bq.version}</version>
            </dependency>
            <dependency>
                <groupId>io.bootique.jetty</groupId>
                <artifactId>bootique-jetty-junit5</artifactId>
                <version>${bq.version}</version>
            </dependency>
            <dependency>
                <groupId>io.bootique.jersey</groupId>
                <artifactId>bootique-jersey-jakarta</artifactId>
                <version>${bq.version}</version>
            </dependency>
            <dependency>
                <groupId>io.bootique.jetty</groupId>
                <artifactId>bootique-jetty-jakarta-junit5</artifactId>
                <version>${bq.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${compiler.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${jar.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${javadoc.plugin.version}</version>
                    <configuration>
                        <additionalOptions>
                            <additionalOption>-Xdoclint:none</additionalOption>
                        </additionalOptions>
                    </configuration>
                </plugin>
                <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-gpg-plugin</artifactId>
                    <version>${gpg.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${source.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${release.plugin.version}</version>
                    <configuration>
                        <autoVersionSubmodules>true</autoVersionSubmodules>

                        <!-- This is to allow test dependencies to be SNAPSHOTS-->
                        <allowTimestampedSnapshots>true</allowTimestampedSnapshots>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${surefire.plugin.version}</version>
                    <configuration>
                        <useModulePath>false</useModulePath>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${failsafe.plugin.version}</version>
                    <configuration>
                        <useModulePath>false</useModulePath>
                    </configuration>
                    <executions>
                        <execution>
                            <id>integration-test</id>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.central</groupId>
                    <artifactId>central-publishing-maven-plugin</artifactId>
                    <version>${central.publishing.plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
            </plugin>
            <!-- This plugin replaces maven-deploy-plugin and "deploy" goal -->
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>sonatype-central</publishingServerId>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>java17</id>
            <activation>
                <jdk>[17,)</jdk>
            </activation>
            <modules>
                <module>agrest-java17-tests</module>
            </modules>
        </profile>
        <!-- Release profile - sign artifacts; do extra checks to ensure we don't miss anything.. -->
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>${gpg.pinentry.mode}</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
