<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>io.github.nagaratnam7891</groupId>
  <artifactId>sigstore_2.1.0</artifactId>
  <version>2.1.8</version>
  <name>Sigstore Example Project</name>
  <description>A sample project demonstrating Sigstore signing for Maven Central publication</description>
  <url>https://github.com/yourusername/sigstore-example</url>
  <licenses>
    <license>
      <name>The Apache License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>
  <developers>
    <developer>
      <id>NagaRatnam</id>
      <name>Naga</name>
      <email>nagaratnam.ratnam@sonatype.com</email>
    </developer>
  </developers>
  <scm>
    <connection>scm:git:git://github.com/nagaratnam7891/sigstore-example.git</connection>
    <developerConnection>scm:git:ssh://github.com:nagaratnam7891/sigstore-example.git</developerConnection>
    <url>https://github.com/nagaratnam7891/sigstore-example/tree/main</url>
  </scm>
  <properties>
    <flatten.maven.plugin.version>1.6.0</flatten.maven.plugin.version>
    <maven.source.plugin.version>3.3.1</maven.source.plugin.version>
    <maven.compiler.target>11</maven.compiler.target>
    <sigstore.maven.plugin.version>2.1.0</sigstore.maven.plugin.version>
    <maven.compiler.source>11</maven.compiler.source>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.javadoc.plugin.version>3.6.3</maven.javadoc.plugin.version>
    <maven.assembly.plugin.version>3.7.1</maven.assembly.plugin.version>
    <revision>1.0.0</revision>
  </properties>
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>flatten-maven-plugin</artifactId>
        <version>${flatten.maven.plugin.version}</version>
        <executions>
          <execution>
            <id>flatten</id>
            <phase>process-resources</phase>
            <goals>
              <goal>flatten</goal>
            </goals>
          </execution>
          <execution>
            <id>flatten.clean</id>
            <phase>clean</phase>
            <goals>
              <goal>clean</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <updatePomFile>true</updatePomFile>
          <flattenMode>resolveCiFriendliesOnly</flattenMode>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.12.1</version>
        <configuration>
          <source>${maven.compiler.source}</source>
          <target>${maven.compiler.target}</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <version>${maven.source.plugin.version}</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${maven.javadoc.plugin.version}</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <doclint>none</doclint>
        </configuration>
      </plugin>
      <plugin>
        <groupId>net.nicoulaj.maven.plugins</groupId>
        <artifactId>checksum-maven-plugin</artifactId>
        <version>1.11</version>
        <executions>
          <execution>
            <id>generate-checksums</id>
            <phase>package</phase>
            <goals>
              <goal>artifacts</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <algorithms>
            <algorithm>MD5</algorithm>
            <algorithm>SHA-1</algorithm>
          </algorithms>
          <attachChecksums>true</attachChecksums>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <id>generate-pom-checksums</id>
            <phase>verify</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <checksum file="C:\Publish\Sigstore_2.0.0\project.build.directory/project.artifactId-2.1.8.pom" fileext=".md5" algorithm="MD5" />
                <checksum file="C:\Publish\Sigstore_2.0.0\project.build.directory/project.artifactId-2.1.8.pom" fileext=".sha1" algorithm="SHA-1" />
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <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>dev.sigstore</groupId>
        <artifactId>sigstore-maven-plugin</artifactId>
        <version>${sigstore.maven.plugin.version}</version>
        <executions>
          <execution>
            <id>sigstore-sign</id>
            <phase>package</phase>
            <goals>
              <goal>sign</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>${maven.assembly.plugin.version}</version>
        <executions>
          <execution>
            <id>create-central-bundle</id>
            <phase>verify</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <descriptors>
            <descriptor>src/assembly/central-bundle.xml</descriptor>
          </descriptors>
          <finalName>project.artifactId-2.1.8-central-bundle</finalName>
          <appendAssemblyId>false</appendAssemblyId>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>no-sign</id>
      <build>
        <plugins>
          <plugin>
            <groupId>dev.sigstore</groupId>
            <artifactId>sigstore-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>sigstore-sign</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <configuration>
              <descriptors>
                <descriptor>src/assembly/central-bundle-unsigned.xml</descriptor>
              </descriptors>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
