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

  <!-- Version is kept in sync with [workspace.package].version in the repo-root
       Cargo.toml by hand, mirroring physure-python/physure/__init__.py's
       __version__ - there is no cross-ecosystem version-sync tooling here. -->
  <groupId>io.github.alexisrx96</groupId>
  <artifactId>physure-java</artifactId>
  <version>0.2.3</version>
  <packaging>jar</packaging>

  <name>physure-java</name>
  <description>JVM JNI bindings for the high-performance physure core physics engine.</description>
  <url>https://github.com/Alexisrx96/physure</url>

  <licenses>
    <license>
      <name>MIT License</name>
      <url>https://github.com/Alexisrx96/physure/blob/main/LICENSE</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Irvin Torres</name>
      <email>irvinrx1996@hotmail.com</email>
    </developer>
  </developers>

  <scm>
    <url>https://github.com/Alexisrx96/physure</url>
    <connection>scm:git:https://github.com/Alexisrx96/physure.git</connection>
    <developerConnection>scm:git:https://github.com/Alexisrx96/physure.git</developerConnection>
    <tag>HEAD</tag>
  </scm>

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

  <build>
    <plugins>
      <!-- Required by Maven Central: sources + javadoc jars alongside the main jar. -->
      <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>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.11.2</version>
        <configuration>
          <source>8</source>
          <failOnError>false</failOnError>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals><goal>jar</goal></goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <!-- GPG signing and the Central Portal publish step only run under -Prelease,
       so a plain `mvn verify` works locally without any signing key configured. -->
  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.2.7</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals><goal>sign</goal></goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <version>0.11.0</version>
            <extensions>true</extensions>
            <configuration>
              <publishingServerId>central</publishingServerId>
              <autoPublish>false</autoPublish>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
