<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>io.fusionauth</groupId>
  <artifactId>java-http</artifactId>
  <version>1.4.0</version>
  <packaging>jar</packaging>

  <name>Java HTTP library (client and server)</name>
  <description>An HTTP library for Java that provides a lightweight server (currently) and client (eventually) both with a goal of high-performance and simplicity</description>
  <url>https://github.com/FusionAuth/java-http</url>

  <distributionManagement>
    <snapshotRepository>
      <name>Central Portal Snapshots</name>
      <id>central-portal-snapshots</id>
      <url>https://central.sonatype.com/repository/maven-snapshots/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </snapshotRepository>
  </distributionManagement>

  <developers>
    <developer>
      <name>Brian Pontarelli</name>
      <email>brian@fusionauth.io</email>
      <organization>FusionAuth</organization>
      <organizationUrl>https://fusionauth.io</organizationUrl>
    </developer>
    <developer>
      <name>Daniel DeGroff</name>
      <email>daniel@fusionauth.io</email>
      <organization>FusionAuth</organization>
      <organizationUrl>https://fusionauth.io</organizationUrl>
    </developer>
  </developers>

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

  <scm>
    <connection>scm:git:ssh://github.com:fusionauth/java-http</connection>
    <url>https://github.com/fusionauth/java-http</url>
  </scm>

  <properties>
    <maven.compiler.source>21</maven.compiler.source>
    <maven.compiler.target>21</maven.compiler.target>
    <project.build.sourceEncoding>UTF8</project.build.sourceEncoding>
  </properties>

  <!--  Testing Dependencies  -->
  <dependencies>
    <dependency>
      <groupId>com.inversoft</groupId>
      <artifactId>jackson5</artifactId>
      <version>3.0.1</version>
      <type>jar</type>
      <scope>test</scope>
      <optional>false</optional>
    </dependency>
    <dependency>
      <groupId>com.inversoft</groupId>
      <artifactId>restify</artifactId>
      <version>4.2.1</version>
      <type>jar</type>
      <scope>test</scope>
      <optional>false</optional>
    </dependency>
    <dependency>
      <groupId>org.testng</groupId>
      <artifactId>testng</artifactId>
      <version>7.11.0</version>
      <type>jar</type>
      <scope>test</scope>
      <optional>false</optional>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-nop</artifactId>
      <version>2.0.17</version>
      <type>jar</type>
      <scope>test</scope>
      <optional>false</optional>
    </dependency>
  </dependencies>

  <build>
    <directory>build</directory>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.14.0</version>
        <configuration>
          <useModulePath>false</useModulePath>
          <!--
           Ideally these would be in testCompilerArgument since this only applies to 'testCompile' goal.
           I have not been able to get it to work. I hate poms.
           -->
          <compilerArgs>
            <arg>--add-exports</arg>
            <arg>java.base/sun.security.x509=ALL-UNNAMED</arg>
            <arg>--add-exports</arg>
            <arg>java.base/sun.security.util=ALL-UNNAMED</arg>
            <arg>-XDignore.symbol.file</arg>
          </compilerArgs>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.5.3</version>
        <configuration>
          <useModulePath>false</useModulePath>
          <argLine>--add-exports java.base/sun.security.x509=ALL-UNNAMED --add-exports java.base/sun.security.util=ALL-UNNAMED</argLine>
          <properties>
            <property>
              <name>listener</name>
              <value>io.fusionauth.http.BaseTest$TestListener</value>
            </property>
          </properties>
          <excludedGroups>performance,timeouts</excludedGroups>
        </configuration>
      </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>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.11.2</version>
        <configuration>
          <doclint>none</doclint>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <version>0.8.0</version>
            <extensions>true</extensions>
            <configuration>
              <publishingServerId>central</publishingServerId>
              <autoPublish>true</autoPublish>
            </configuration>
          </plugin>
          <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>
                <configuration>
                  <keyname>${gpg.keyname}</keyname>
                  <skip>false</skip>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>