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

  <groupId>org.openmbee</groupId>
  <artifactId>opensysml-parent</artifactId>
  <version>0.12.0</version>
  <packaging>pom</packaging>

  <name>OpenSysML Java clients</name>
  <description>Java client for the OpenSysML sysml-grpc service, and the conformance runner that
    exercises it against the language-independent suite.</description>
  <url child.project.url.inherit.append.path="false">https://github.com/Open-MBEE/OpenSysML</url>
  <inceptionYear>2025</inceptionYear>

  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <organization>
    <name>Open-MBEE Foundation</name>
    <url>https://www.openmbee.org/</url>
  </organization>

  <developers>
    <developer>
      <name>Open-MBEE Foundation</name>
      <organization>Open-MBEE Foundation</organization>
      <organizationUrl>https://www.openmbee.org/</organizationUrl>
    </developer>
  </developers>

  <scm child.scm.connection.inherit.append.path="false"
       child.scm.developerConnection.inherit.append.path="false"
       child.scm.url.inherit.append.path="false">
    <connection>scm:git:https://github.com/Open-MBEE/OpenSysML.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/Open-MBEE/OpenSysML.git</developerConnection>
    <url>https://github.com/Open-MBEE/OpenSysML</url>
    <tag>HEAD</tag>
  </scm>

  <issueManagement>
    <system>GitHub Issues</system>
    <url>https://github.com/Open-MBEE/OpenSysML/issues</url>
  </issueManagement>

  <modules>
    <module>opensysml-client</module>
    <module>opensysml-conformance</module>
  </modules>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <!-- 17 is the floor a host application can be expected to offer: Eclipse
         2023-03 and later run on it, and nothing here needs a later release. -->
    <maven.compiler.release>17</maven.compiler.release>
    <protobuf.version>4.36.2</protobuf.version>
    <junit.version>6.1.3</junit.version>
    <gson.version>2.15.0</gson.version>
    <sigstore.version>2.4.0</sigstore.version>
    <!-- sigstore-java's transitive dependencies, held past their known advisories
         (OSV over the CycloneDX SBOM): grpc-netty-shaded, bcprov/bcpkix, guava and the
         Apache HttpComponents its Google HTTP client transport rests on. -->
    <grpc.version>1.85.1</grpc.version>
    <bouncycastle.version>1.86</bouncycastle.version>
    <guava.version>33.7.2-jre</guava.version>
    <httpcomponents.client5.version>5.6.5</httpcomponents.client5.version>
    <httpcomponents.core5.version>5.4.4</httpcomponents.core5.version>
    <maven.compiler.plugin.version>3.16.0</maven.compiler.plugin.version>
    <maven.surefire.plugin.version>3.6.1</maven.surefire.plugin.version>
    <maven.jar.plugin.version>3.5.1</maven.jar.plugin.version>
    <maven.source.plugin.version>3.4.0</maven.source.plugin.version>
    <maven.javadoc.plugin.version>3.12.0</maven.javadoc.plugin.version>
    <maven.gpg.plugin.version>3.2.8</maven.gpg.plugin.version>
    <maven.antrun.plugin.version>3.2.0</maven.antrun.plugin.version>
    <protobuf.maven.plugin.version>5.1.11</protobuf.maven.plugin.version>
    <central.publishing.plugin.version>0.12.0</central.publishing.plugin.version>
    <jacoco.plugin.version>0.8.16</jacoco.plugin.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.google.protobuf</groupId>
        <artifactId>protobuf-java</artifactId>
        <version>${protobuf.version}</version>
      </dependency>
      <dependency>
        <groupId>com.google.protobuf</groupId>
        <artifactId>protobuf-java-util</artifactId>
        <version>${protobuf.version}</version>
      </dependency>
      <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>${gson.version}</version>
      </dependency>
      <dependency>
        <groupId>dev.sigstore</groupId>
        <artifactId>sigstore-java</artifactId>
        <version>${sigstore.version}</version>
      </dependency>
      <dependency>
        <groupId>io.grpc</groupId>
        <artifactId>grpc-bom</artifactId>
        <version>${grpc.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcprov-jdk18on</artifactId>
        <version>${bouncycastle.version}</version>
      </dependency>
      <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcpkix-jdk18on</artifactId>
        <version>${bouncycastle.version}</version>
      </dependency>
      <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcutil-jdk18on</artifactId>
        <version>${bouncycastle.version}</version>
      </dependency>
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>${guava.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.httpcomponents.client5</groupId>
        <artifactId>httpclient5</artifactId>
        <version>${httpcomponents.client5.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.httpcomponents.core5</groupId>
        <artifactId>httpcore5</artifactId>
        <version>${httpcomponents.core5.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.httpcomponents.core5</groupId>
        <artifactId>httpcore5-h2</artifactId>
        <version>${httpcomponents.core5.version}</version>
      </dependency>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven.compiler.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>${maven.antrun.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>io.github.ascopes</groupId>
          <artifactId>protobuf-maven-plugin</artifactId>
          <version>${protobuf.maven.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${maven.surefire.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${maven.jar.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>${maven.source.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${maven.javadoc.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>${maven.gpg.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>${jacoco.plugin.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <!-- The XML report is what the SonarCloud scan reads; no threshold is
           enforced here, the quality gate holds the line. -->
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>prepare-agent</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>report</id>
            <phase>test</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <!-- Everything Maven Central requires of an upload, kept out of the default
         build so `mvn install` needs no signing key. See docs/project/releasing.md. -->
    <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>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <version>${central.publishing.plugin.version}</version>
            <extensions>true</extensions>
            <configuration>
              <publishingServerId>central</publishingServerId>
              <!-- The release job publishes the validated deployment itself and
                   waits until it is published, so a green job means the version
                   is on Central. -->
              <autoPublish>true</autoPublish>
              <waitUntil>published</waitUntil>
              <!-- Bound of that silent wait, in seconds (1800 is the plugin's floor); the publish
                   step's no_output_timeout in .circleci/config.yml must exceed it (tests/hygiene). -->
              <waitMaxTime>1800</waitMaxTime>
              <waitPollingInterval>5</waitPollingInterval>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
