<?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>

    <groupId>org.rlbot.commons</groupId>
    <artifactId>rlbot-framework</artifactId>
    <version>3.0.0</version>
    <packaging>jar</packaging>

    <name>${project.groupId}:${project.artifactId}</name>
    <description>A library to create Rocket League bots by interfacing with the RLBot v5 framework through Java.</description>
    <url>https://github.com/RLBot/java-interface</url>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://opensource.org/license/mit</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Nicolaj Østerby Jensen</name>
            <email>nicoesterby@gmail.com</email>
            <organization>RLBot</organization>
            <organizationUrl>https://rlbot.org/</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/rlbot/java-interface.git</connection>
        <developerConnection>scm:git:ssh://github.com:rlbot/java-interface.git</developerConnection>
        <url>https://github.com/RLBot/java-interface</url>
    </scm>

    <properties>
        <maven.compiler.source>16</maven.compiler.source>
        <maven.compiler.target>16</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <gpg.skip>true</gpg.skip><!-- by default skip gpg -->
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.google.flatbuffers</groupId>
            <artifactId>flatbuffers-java</artifactId>
            <version>25.2.10</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- This plugin makes the deploy task deploy to MavenCentral -->
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>0.9.0</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                </configuration>
            </plugin>
            <!-- This plugin calls the generate-flatbuffer script on build -->
            <plugin>
                <artifactId>exec-maven-plugin</artifactId>
                <groupId>org.codehaus.mojo</groupId>
                <version>1.6.0</version>
                <executions>
                    <execution>
                        <id>generate-flatbuffers</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>generate-flatbuffers.bat</executable>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- This plugin adds the generate flatbuffer source code to the jar -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/generated/java</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- This plugin ensures source code is included in the distribution -->
            <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</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- This plugin ensures javadoc comments are included in the distribution -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.12.0</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <doclint>all,-missing</doclint>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- This plugin signs uploaded artifacts with gpg which is required for MavenCentral uploads -->
<!--            <plugin>-->
<!--                <groupId>org.apache.maven.plugins</groupId>-->
<!--                <artifactId>maven-gpg-plugin</artifactId>-->
<!--                <version>3.2.8</version>-->
<!--                <executions>-->
<!--                    <execution>-->
<!--                        <id>sign-artifacts</id>-->
<!--                        <phase>verify</phase>-->
<!--                        <goals>-->
<!--                            <goal>sign</goal>-->
<!--                        </goals>-->
<!--                    </execution>-->
<!--                </executions>-->
<!--            </plugin>-->
            <plugin>
                <groupId>org.simplify4u.plugins</groupId>
                <artifactId>sign-maven-plugin</artifactId>
                <version>1.1.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <!-- This profile only runs when building a full release -->
            <id>release</id>
            <properties>
                <!-- Do not skip gpg signing during release -->
                <gpg.skip>false</gpg.skip>
            </properties>
        </profile>
    </profiles>
</project>