<?xml version="1.0" encoding="UTF-8"?>

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>dev.dominion.ecs</groupId>
    <artifactId>dominion-ecs</artifactId>
    <packaging>pom</packaging>
    <version>${revision}</version>

    <name>Dominion ECS Project</name>
    <description>Dominion is an Entity Component System library for Java</description>
    <url>https://www.dominion.dev</url>

    <modules>
        <module>dominion-ecs-api</module>
        <module>dominion-ecs-engine</module>
        <module>dominion-ecs-engine-benchmarks</module>
        <module>dominion-ecs-examples</module>
    </modules>

    <properties>
        <!-- Project-->
        <revision>0.9.0-SNAPSHOT</revision>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.release>17</maven.compiler.release>
        <!-- Plugins-->
        <maven-assembly-plugin>3.3.0</maven-assembly-plugin>
        <maven-clean-plugin>3.1.0</maven-clean-plugin>
        <maven-resources-plugin>3.0.2</maven-resources-plugin>
        <maven-compiler-plugin>3.8.0</maven-compiler-plugin>
        <maven-surefire-plugin>3.0.0-M5</maven-surefire-plugin>
        <maven-javadoc-plugin>3.4.0</maven-javadoc-plugin>
        <maven-install-plugin>2.5.2</maven-install-plugin>
        <maven-deploy-plugin>2.8.2</maven-deploy-plugin>
        <maven-gpg-plugin>1.6</maven-gpg-plugin>
        <maven-site-plugin>3.7.1</maven-site-plugin>
        <maven-source-plugin>3.2.0</maven-source-plugin>
        <maven-jar-plugin>3.2.0</maven-jar-plugin>
        <maven-project-info-reports-plugin>3.0.0</maven-project-info-reports-plugin>
        <license-maven-plugin>4.1</license-maven-plugin>
        <properties-maven-plugin>1.0.0</properties-maven-plugin>
        <flatten-maven-plugin>1.2.2</flatten-maven-plugin>
        <nexus-staging-maven-plugin>1.6.13</nexus-staging-maven-plugin>
        <!--Dependencies - No core modules build dependencies-->
        <junit-jupiter-engine>5.8.2</junit-jupiter-engine>
        <jmh-core>1.36</jmh-core>
        <jol-core>0.16</jol-core>
    </properties>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://www.opensource.org/licenses/mit-license.php</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <email>enrico.stara@gmail.com</email>
            <name>Enrico Stara</name>
            <url>https://github.com/enricostara</url>
            <id>enricostara</id>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/dominion-dev/dominion-ecs-java.git</connection>
        <developerConnection>scm:git:git@github.com:dominion-dev/dominion-ecs-java.git</developerConnection>
        <url>https://github.com/dominion-dev/dominion-ecs-java</url>
    </scm>

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

    <issueManagement>
        <url>https://github.com/dominion-dev/dominion-ecs-java/issues</url>
        <system>GitHub Issues</system>
    </issueManagement>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>${junit-jupiter-engine}</version>
            </dependency>
            <dependency>
                <groupId>org.openjdk.jmh</groupId>
                <artifactId>jmh-core</artifactId>
                <version>${jmh-core}</version>
            </dependency>
            <dependency>
                <groupId>org.openjdk.jmh</groupId>
                <artifactId>jmh-generator-annprocess</artifactId>
                <version>${jmh-core}</version>
            </dependency>
            <dependency>
                <groupId>org.openjdk.jol</groupId>
                <artifactId>jol-core</artifactId>
                <version>${jol-core}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>flatten-maven-plugin</artifactId>
                <configuration>
                    <flattenMode>ossrh</flattenMode>
                </configuration>
                <executions>
                    <execution>
                        <id>flatten</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>flatten</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <configuration>
                    <header>LIC_HEADER</header>
                    <strictCheck>false</strictCheck>
                    <includes>
                        <include>**/*.java</include>
                    </includes>
                    <excludes>
                        <exclude>src/test/**</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <phase>test</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </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>
        </plugins>
        <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
            <plugins>
                <plugin>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>${maven-assembly-plugin}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>${maven-clean-plugin}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${maven-resources-plugin}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>${maven-install-plugin}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${maven-deploy-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${maven-gpg-plugin}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>${maven-site-plugin}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven-source-plugin}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>${maven-project-info-reports-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven-jar-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>flatten-maven-plugin</artifactId>
                    <version>${flatten-maven-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>${license-maven-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>properties-maven-plugin</artifactId>
                    <version>${properties-maven-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>${nexus-staging-maven-plugin}</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>cd-pipeline</id>
            <activation>
                <property>
                    <name>env</name>
                    <value>cd-maven</value>
                </property>
                <activeByDefault>false</activeByDefault>
            </activation>
            <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>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
