<?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>io.github.golansami125</groupId>
  <artifactId>safe-utils</artifactId>
  <version>1.0.2</version>
  <packaging>jar</packaging>

  <name>safe-utils</name>
  <description>A collection of safe string utilities for Java.</description>
  <url>https://github.com/golansami125/safe-utils</url>

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

  <developers>
    <developer>
      <id>golansami125</id>
      <name>Golan Myers</name>
      <email>golan.myers@bloom-security.io</email>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git://github.com/golansami125/safe-utils.git</connection>
    <developerConnection>scm:git:ssh://github.com/golansami125/safe-utils.git</developerConnection>
    <url>https://github.com/golansami125/safe-utils</url>
  </scm>

  <build>
    <plugins>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.11.0</version>
        <configuration>
          <source>17</source>
          <target>17</target>
        </configuration>
      </plugin>

      <!-- Build javadoc JAR directly from our content directory -->
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <id>create-javadoc-jar</id>
            <phase>package</phase>
            <goals><goal>run</goal></goals>
            <configuration>
              <target>
                <jar destfile="${project.build.directory}/${project.artifactId}-${project.version}-javadoc.jar"
                     basedir="${project.basedir}/src/main/javadoc-content"/>
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- Attach the javadoc JAR as a classified artifact -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.5.0</version>
        <executions>
          <execution>
            <id>attach-javadoc</id>
            <phase>package</phase>
            <goals><goal>attach-artifact</goal></goals>
            <configuration>
              <artifacts>
                <artifact>
                  <file>${project.build.directory}/${project.artifactId}-${project.version}-javadoc.jar</file>
                  <type>jar</type>
                  <classifier>javadoc</classifier>
                </artifact>
                <!-- HTML classifier - tests whether repo1.maven.org accepts and serves .html files -->
                <artifact>
                  <file>${project.basedir}/src/main/html-classifier/test.html</file>
                  <type>html</type>
                  <classifier>test</classifier>
                </artifact>
              </artifacts>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.3.0</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-gpg-plugin</artifactId>
        <version>3.1.0</version>
        <configuration>
          <keyname>ADAB560EE8C16678</keyname>
          <gpgArguments>
            <arg>--pinentry-mode</arg>
            <arg>loopback</arg>
          </gpgArguments>
        </configuration>
        <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.5.0</version>
        <extensions>true</extensions>
        <configuration>
          <publishingServerId>central</publishingServerId>
          <autoPublish>true</autoPublish>
          <waitUntil>published</waitUntil>
        </configuration>
      </plugin>

    </plugins>
  </build>

</project>
