<?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>de.gematik.pki</groupId>
  <artifactId>gemLibPki</artifactId>
  <version>3.1.1</version>
  <packaging>jar</packaging>
  <name>GemLibPki</name>
  <description>library for implementation and tests of the gematik pki specification</description>
  <url>https://github.com/gematik/ref-GemLibPki</url>

  <organization>
    <name>gematik GmbH</name>
    <url>https://www.gematik.de</url>
  </organization>

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

  <developers>
    <developer>
      <name>gematik</name>
      <email>software-development@gematik.de</email>
      <url>https://gematik.github.io/</url>
      <organization>gematik GmbH</organization>
      <organizationUrl>https://www.gematik.de/</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git://github.com/gematik/ref-GemLibPki.git</connection>
    <developerConnection>scm:git:ssh://git@github.com:gematik/ref-GemLibPki.git</developerConnection>
    <url>https://github.com/gematik/ref-GemLibPki</url>
  </scm>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/gematik/ref-GemLibPki/issues</url>
  </issueManagement>

  <properties>
    <project.build.outputTimestamp>1738923164</project.build.outputTimestamp>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.encoding>${project.build.sourceEncoding}</maven.compiler.encoding>
    <java.version>17</java.version>
    <version.maven>3.6.3</version.maven>

    <!-- dependencies -->
    <version.assertj>3.27.3</version.assertj>
    <version.awaitility>4.2.2</version.awaitility>
    <version.bouncycastle>1.80</version.bouncycastle>
    <version.commons-lang3>3.17.0</version.commons-lang3>
    <version.dss-tsl-validation>6.1</version.dss-tsl-validation>
    <version.httpcore5>5.3.3</version.httpcore5>
    <version.jakarta.xml.bind-api>4.0.2</version.jakarta.xml.bind-api>
    <version.junit-jupiter>5.11.4</version.junit-jupiter>
    <version.log4j>2.24.3</version.log4j>
    <version.lombok>1.18.36</version.lombok>
    <version.mockito>5.15.2</version.mockito>
    <version.unirest-java-core>4.4.5</version.unirest-java-core>
    <version.wiremock>3.11.0</version.wiremock>
    <version.xades4j>2.4.0</version.xades4j>
    <version.xmlunit>2.10.0</version.xmlunit>

    <!--  plugins -->
    <version.jacoco-maven-plugin>0.8.12</version.jacoco-maven-plugin>
    <version.maven-clean-plugin>3.4.0</version.maven-clean-plugin>
    <version.maven-compiler-plugin>3.13.0</version.maven-compiler-plugin>
    <maven-deploy-plugin.version>3.1.3</maven-deploy-plugin.version>
    <version.maven-enforcer-plugin>3.5.0</version.maven-enforcer-plugin>
    <version.maven-gpg-plugin>3.2.7</version.maven-gpg-plugin>
    <version.maven-jar-plugin>3.4.2</version.maven-jar-plugin>
    <version.maven-javadoc-plugin>3.11.2</version.maven-javadoc-plugin>
    <version.maven-source-plugin>3.3.1</version.maven-source-plugin>
    <version.maven-surefire-plugin>3.5.2</version.maven-surefire-plugin>
    <version.nexus-staging-maven-plugin>1.7.0</version.nexus-staging-maven-plugin>
    <version.sonar-maven-plugin>5.0.0.4389</version.sonar-maven-plugin>
    <version.spotless.google-java-format>1.17.0</version.spotless.google-java-format>
    <version.spotless-maven-plugin>2.44.2</version.spotless-maven-plugin>
    <!-- settings for upload to sonar server -->
    <sonar.coverage.jacoco.xmlReportPaths>${project.reporting.outputDirectory}/jacoco/index.xml</sonar.coverage.jacoco.xmlReportPaths>
    <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
    <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
    <sonar.language>java</sonar.language>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.googlecode.xades4j</groupId>
      <artifactId>xades4j</artifactId>
      <version>${version.xades4j}</version>
    </dependency>

    <dependency>
      <groupId>jakarta.xml.bind</groupId>
      <artifactId>jakarta.xml.bind-api</artifactId>
      <version>${version.jakarta.xml.bind-api}</version>
    </dependency>

    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>${version.assertj}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.awaitility</groupId>
      <artifactId>awaitility</artifactId>
      <version>${version.awaitility}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcpkix-jdk18on</artifactId>
      <version>${version.bouncycastle}</version>
    </dependency>
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcprov-jdk18on</artifactId>
      <version>${version.bouncycastle}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>${version.commons-lang3}</version>
    </dependency>

    <dependency>
      <groupId>eu.europa.ec.joinup.sd-dss</groupId>
      <artifactId>dss-tsl-validation</artifactId>
      <version>${version.dss-tsl-validation}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
      <version>${version.log4j}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-slf4j-impl</artifactId>
      <version>${version.log4j}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <version>${version.junit-jupiter}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>${version.lombok}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>com.konghq</groupId>
      <artifactId>unirest-java-core</artifactId>
      <version>${version.unirest-java-core}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents.core5</groupId>
      <artifactId>httpcore5</artifactId>
      <version>${version.httpcore5}</version>
    </dependency>

    <dependency>
      <groupId>org.wiremock</groupId>
      <artifactId>wiremock</artifactId>
      <version>${version.wiremock}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.xmlunit</groupId>
      <artifactId>xmlunit-assertj3</artifactId>
      <version>${version.xmlunit}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.xmlunit</groupId>
      <artifactId>xmlunit-jakarta-jaxb-impl</artifactId>
      <version>${version.xmlunit}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>${version.mockito}</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>
    <plugins>

      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${version.jacoco-maven-plugin}</version>
        <executions>
          <execution>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>report</id>
            <goals>
              <goal>report</goal>
            </goals>
            <phase>prepare-package</phase>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <version>${version.maven-clean-plugin}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${version.maven-compiler-plugin}</version>
        <configuration>
          <encoding>${project.build.sourceEncoding}</encoding>
          <source>${java.version}</source>
          <target>${java.version}</target>
          <debug>true</debug>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>${version.maven-enforcer-plugin}</version>
        <executions>
          <execution>
            <id>enforce-versions</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>${version.maven}</version>
                </requireMavenVersion>
                <requireJavaVersion>
                  <version>[${java.version},17.99.99]</version>
                </requireJavaVersion>
              </rules>
              <fail>true</fail>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${version.maven-jar-plugin}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${version.maven-javadoc-plugin}</version>
        <configuration>
          <doclint>none</doclint>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>${version.maven-source-plugin}</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${version.maven-surefire-plugin}</version>
      </plugin>

      <!-- to upload jacoco results to sonar server via mvn sonar:sonar-->
      <plugin>
        <groupId>org.sonarsource.scanner.maven</groupId>
        <artifactId>sonar-maven-plugin</artifactId>
        <version>${version.sonar-maven-plugin}</version>
      </plugin>

      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <version>${version.spotless-maven-plugin}</version>
        <configuration>
          <formats>
            <format>
              <includes>
                <include>**/*.yml</include>
                <include>.gitignore</include>
              </includes>
              <trimTrailingWhitespace/>
              <endWithNewline/>
              <indent>
                <spaces>true</spaces>
                <spacesPerTab>2</spacesPerTab>
              </indent>
            </format>
          </formats>
          <pom>
            <includes>
              <include>pom.xml</include>
            </includes>
            <sortPom>
              <encoding>UTF-8</encoding>
              <expandEmptyElements>false</expandEmptyElements>
              <nrOfIndentSpace>2</nrOfIndentSpace>
              <predefinedSortOrder>recommended_2008_06</predefinedSortOrder>
            </sortPom>
          </pom>
          <java>
            <googleJavaFormat>
              <version>${version.spotless.google-java-format}</version>
              <style>GOOGLE</style>
              <reflowLongStrings>true</reflowLongStrings>
            </googleJavaFormat>
            <licenseHeader>
              <file>LICENSE_PLACEHOLDER_FILE</file>
            </licenseHeader>
          </java>
          <groovy>
            <includes>
              <include>**/*.Jenkinsfile</include>
            </includes>
            <importOrder/>
          </groovy>
          <markdown>
            <includes>
              <include>**/*.md</include>
            </includes>
            <excludes>
              <exclude>**/target/**/*</exclude>
            </excludes>
          </markdown>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>${maven-deploy-plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>2.5.0</version>
        <executions>
          <execution>
            <goals>
              <goal>aggregate-third-party-report</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>external</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${version.maven-gpg-plugin}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <goals>
                  <goal>sign</goal>
                </goals>
                <phase>verify</phase>
                <configuration>
                  <gpgArguments>
                    <arg>--pinentry-mode</arg>
                    <arg>loopback</arg>
                  </gpgArguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>${version.nexus-staging-maven-plugin}</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
              <stagingProgressTimeoutMinutes>20</stagingProgressTimeoutMinutes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
