<?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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <artifactId>engine-pi</artifactId>
    <version>0.26.0</version>
    <packaging>jar</packaging>

    <parent>
        <groupId>de.pirckheimer-gymnasium</groupId>
        <artifactId>engine-pi-meta</artifactId>
        <version>0.26.0</version>
    </parent>

    <name>Engine Pi</name>
    <description>A beginner-orientated 2D game engine with German documentation. Its main purpose is to develop enthusiasm for programming and computer science through fast, visible and strong achievements.</description>
    <url>https://github.com/engine-pi/engine-pi</url>

    <licenses>
        <license>
            <name>The GNU General Public License, Version 3.0</name>
            <url>https://www.gnu.org/licenses/gpl-3.0.txt</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>Josef Friedrich</name>
            <email>josef.friedrich@pirckheimer-gymnasium.de</email>
            <organizationUrl>http://pirckheimer-gymnasium.de</organizationUrl>
        </developer>
    </developers>
    <scm>
        <connection>scm:git:git://github.com/engine-pi/engine-pi.git</connection>
        <developerConnection>scm:git:ssh://github.com:engine-pi/engine-pi.git</developerConnection>
        <url>https://github.com/engine-pi/engine-pi</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>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
    </properties>


    <dependencies>
        <dependency>
            <groupId>com.googlecode.soundlibs</groupId>
            <artifactId>jorbis</artifactId>
            <version>0.0.17.4</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.googlecode.soundlibs</groupId>
            <artifactId>tritonus-share</artifactId>
            <version>0.3.7.4</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.googlecode.soundlibs</groupId>
            <artifactId>vorbisspi</artifactId>
            <version>1.0.3.3</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.googlecode.soundlibs</groupId>
            <artifactId>mp3spi</artifactId>
            <version>1.9.5.4</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>5.11.0-M1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <version>5.11.0-M1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <!-- Default is ${project.artifactId}-${project.version}, to get jar files without the
        version use ${project.artifactId} -->
        <finalName>${project.artifactId}-${project.version}</finalName>

        <!-- https://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html -->
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
            </resource>
            <resource>
                <directory>src/main/resources-filtered</directory>
                <filtering>true</filtering>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.2.5</version>
                <configuration>
                    <includes>
                        <include>**/*Test.java</include>
                    </includes>
                </configuration>
            </plugin>
            <!-- https://maven.apache.org/plugins/maven-assembly-plugin/usage.html -->
            <!-- https://maven.apache.org/plugins/maven-assembly-plugin/single-mojo.html -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>3.7.1</version>
                <configuration>
                    <!-- Set to false to exclude the assembly id from the assembly final name, and
                    to create the resultant assembly artifacts without classifier. As such, an
                    assembly artifact having the same format as the packaging of the current Maven
                    project will replace the file for this main project artifact. -->
                    <appendAssemblyId>false</appendAssemblyId>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <mainClass>de.pirckheimer_gymnasium.engine_pi.debug.MainAnimation</mainClass>
                        </manifest>
                    </archive>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.6.3</version>
                <configuration>
                    <!-- to disable the "missing" warnings -->
                    <doclint>all,-missing</doclint>
                    <!--
                    https://maven.apache.org/plugins/maven-javadoc-plugin/examples/tag-configuration.html -->
                    <tags>
                        <tag>
                            <name>jbox.2d</name>
                            <placement>a</placement>
                            <head>jbox2d source code:</head>
                        </tag>
                        <tag>
                            <name>box.2d</name>
                            <placement>a</placement>
                            <head>box2d source code:</head>
                        </tag>
                    </tags>
                    <!--
                    https://maven.apache.org/plugins/maven-javadoc-plugin/examples/links-configuration.html -->
                    <links>
                        <link>https://javadoc.io/doc/de.pirckheimer-gymnasium/engine-pi-demos/latest</link>
                    </links>
                    <!--
                    https://maven.apache.org/plugins/maven-javadoc-plugin/examples/exclude-package-names.html -->
                    <excludePackageNames>org.jbox2d.*</excludePackageNames>
                    <!--
                    https://maven.apache.org/plugins/maven-javadoc-plugin/examples/stylesheet-configuration.html -->
                    <stylesheetfile>javadoc-stylesheet.css</stylesheetfile>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <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>
            <!-- https://maven.apache.org/plugins/maven-gpg-plugin/usage.html -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                        <configuration>
                            <!-- This is necessary for gpg to not try to use the pinentry programs -->
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <!-- https://github.com/git-commit-id/git-commit-id-maven-plugin -->
                <groupId>io.github.git-commit-id</groupId>
                <artifactId>git-commit-id-maven-plugin</artifactId>

                <version>9.0.0</version>
                <executions>
                    <execution>
                        <id>get-the-git-infos</id>
                        <goals>
                            <goal>revision</goal>
                        </goals>
                        <phase>validate</phase>
                    </execution>
                </executions>
                <!-- https://github.com/git-commit-id/git-commit-id-maven-plugin/blob/master/docs/using-the-plugin.md -->
                <configuration>
                    <generateGitPropertiesFile>true</generateGitPropertiesFile>
                    <generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
                    <dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>0.4.0</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                    <tokenAuth>true</tokenAuth>
                    <autoPublish>true</autoPublish>
                </configuration>
            </plugin>
            <plugin>
                <groupId>net.revelc.code.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
                <version>2.23.0</version>
                <configuration>
                    <configFile>../.formatter/school.xml</configFile>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
