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

  <groupId>com.code-intelligence</groupId>
  <artifactId>cifuzz-maven-extension</artifactId>
  <version>1.13.2</version>
  <licenses>
      <license>
          <name>The Apache License, Version 2.0</name>
          <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
          <distribution>repo</distribution>
      </license>
  </licenses>
  <name>CI Fuzz Maven extension</name>
  <description>cifuzz is a CLI tool that helps you to integrate and run fuzzing based tests into your project</description>
  <url>https://www.code-intelligence.com</url>
  <scm>
    <url>https://github.com/CodeIntelligenceTesting/cifuzz-maven-extension</url>
  </scm>
  <organization>
    <name>Code Intelligence GmbH</name>
    <url>https://www.code-intelligence.com</url>
  </organization>
  <developers>
    <developer>
      <name>Code Intelligence Team</name>
      <email>info@code-intelligence.com</email>
      <organization>Code Intelligence GmbH</organization>
    </developer>
  </developers>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.release>8</maven.compiler.release>
    <kotlin.version>1.9.10</kotlin.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>3.9.4</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.inject</groupId>
      <artifactId>javax.inject</artifactId>
      <version>1</version>
      <scope>provided</scope>
    </dependency>

    <!-- for testing -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>5.10.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-stdlib-jdk8</artifactId>
      <version>${kotlin.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest</artifactId>
      <version>2.2</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
        <id>ossrh</id>
        <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.eclipse.sisu</groupId>
          <artifactId>sisu-maven-plugin</artifactId>
          <version>0.3.5</version>
          <executions>
            <execution>
              <id>generate-index</id>
              <goals>
                <goal>main-index</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>

    <!-- for testing -->
    <testSourceDirectory>src/test/kotlin</testSourceDirectory>
    <plugins>
      <!-- (1) use kotlin to write tests -->
      <plugin>
        <groupId>org.jetbrains.kotlin</groupId>
        <!--suppress KotlinMavenPluginPhase -->
        <artifactId>kotlin-maven-plugin</artifactId>
        <version>${kotlin.version}</version>
        <executions>
          <execution>
            <id>test-compile</id>
            <goals>
              <goal>test-compile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <!-- (2) the 'install' phase starts with the actual install -->
      <plugin>
        <artifactId>maven-install-plugin</artifactId>
        <version>3.1.1</version>
      </plugin>
      <!-- (3) the tests run in the 'install' phase after the actual install -->
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.1.2</version>
        <executions>
          <execution>
            <id>default-test</id>
            <phase>install</phase>
          </execution>
        </executions>
      </plugin>

      <!-- for deploying -->
      <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-javadoc-plugin</artifactId>
        <version>3.6.2</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>3.1.0</version>
        <configuration>
          <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.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.6.13</version>
        <extensions>true</extensions>
        <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>true</autoReleaseAfterClose>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <version>2.43.0</version>
        <configuration>
          <formats>
            <format>
              <includes>
                <include>.gitattributes</include>
                <include>.gitignore</include>
              </includes>
              <trimTrailingWhitespace/>
              <endWithNewline/>
              <indent>
                <spaces>true</spaces>
              </indent>
            </format>
          </formats>
          <kotlin>
            <includes>
              <include>**/*.kt</include>
              <include>**/*.kts</include>
            </includes>
            <ktlint>
              <editorConfigOverride>
                <ktlint_standard_package-name>disabled</ktlint_standard_package-name>
              </editorConfigOverride>
            </ktlint>
          </kotlin>
          <java>
            <includes>
              <include>**/*.java</include>
            </includes>
            <importOrder/>
            <removeUnusedImports/>
            <cleanthat/>
            <formatAnnotations/>
            <googleJavaFormat/>
          </java>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
