<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>se.swedenconnect.opensaml</groupId>
  <artifactId>opensaml-swedish-eid</artifactId>
  <packaging>jar</packaging>
  <version>2.2.8</version>

  <name>Sweden Connect :: Swedish eID OpenSAML extensions</name>
  <description>OpenSAML 5.X extension library for the Swedish eID Framework</description>
  <url>https://github.com/swedenconnect/opensaml-swedish-eid</url>

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

  <scm>
    <connection>scm:https://github.com/swedenconnect/opensaml-swedish-eid.git</connection>
    <developerConnection>scm:https://github.com/swedenconnect/opensaml-swedish-eid.git</developerConnection>
    <url>https://github.com/swedenconnect/opensaml-swedish-eid/tree/main</url>
  </scm>

  <developers>
    <developer>
      <name>Martin Lindström</name>
      <email>martin@idsec.se</email>
      <organization>IDsec Solutions AB</organization>
      <organizationUrl>https://www.idsec.se</organizationUrl>
    </developer>
  </developers>

  <organization>
    <name>Sweden Connect</name>
    <url>https://www.swedenconnect.se</url>
  </organization>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>17</java.version>

    <opensaml.version>5.1.6</opensaml.version>
    <shib.support.version>9.1.6</shib.support.version>

    <nimbus.version>10.6</nimbus.version>
    <bc.version>1.82</bc.version>
    <spring.version>6.2.14</spring.version>
    <slf4j.version>2.0.17</slf4j.version>
    <junit.version>5.14.1</junit.version>
  </properties>

  <repositories>
    <repository>
      <id>central</id>
      <name>Maven Central</name>
      <url>https://repo1.maven.org/maven2/</url>
    </repository>
    <repository>
      <id>shibboleth</id>
      <name>Shibboleth Maven Repo</name>
      <url>https://build.shibboleth.net/nexus/content/repositories/releases</url>
    </repository>
  </repositories>

  <dependencyManagement>

    <dependencies>

      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>

      <dependency>
        <groupId>commons-codec</groupId>
        <artifactId>commons-codec</artifactId>
        <version>1.20.0</version>
      </dependency>

      <dependency>
        <groupId>org.apache.httpcomponents.core5</groupId>
        <artifactId>httpcore5</artifactId>
        <version>5.3.6</version>
      </dependency>

      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>2.20.1</version>
      </dependency>

      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.20.1</version>
      </dependency>

      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-annotations</artifactId>
        <version>2.20</version>
      </dependency>

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

      <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcutil-jdk18on</artifactId>
        <version>${bc.version}</version>
      </dependency>

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

      <dependency>
        <groupId>org.apache.santuario</groupId>
        <artifactId>xmlsec</artifactId>
        <version>3.0.6</version>
      </dependency>

      <dependency>
        <groupId>org.opensaml</groupId>
        <artifactId>opensaml-bom</artifactId>
        <version>${opensaml.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>com.google.errorprone</groupId>
        <artifactId>error_prone_annotations</artifactId>
        <version>2.44.0</version>
      </dependency>

    </dependencies>

  </dependencyManagement>


  <dependencies>

    <dependency>
      <groupId>jakarta.annotation</groupId>
      <artifactId>jakarta.annotation-api</artifactId>
      <version>3.0.0</version>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.santuario</groupId>
      <artifactId>xmlsec</artifactId>
    </dependency>

    <!-- OpenSAML -->
    <dependency>
      <groupId>se.swedenconnect.opensaml</groupId>
      <artifactId>opensaml-security-ext</artifactId>
      <version>4.1.8</version>
    </dependency>

    <dependency>
      <groupId>se.swedenconnect.opensaml</groupId>
      <artifactId>opensaml-addons</artifactId>
      <version>2.1.7</version>
    </dependency>

    <!-- JSON support -->
    <dependency>
      <groupId>com.nimbusds</groupId>
      <artifactId>nimbus-jose-jwt</artifactId>
      <version>${nimbus.version}</version>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-annotations</artifactId>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
    </dependency>

    <!-- For testing -->
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
      <version>${spring.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
      <version>${spring.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
      <version>${spring.version}</version>
      <scope>test</scope>
    </dependency>

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

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

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>${slf4j.version}</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>

    <plugins>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.14.1</version>
        <configuration>
          <release>${java.version}</release>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.5.4</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.4.2</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <version>3.5.0</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.6.1</version>
        <executions>
          <execution>
            <id>enforce</id>
            <configuration>
              <rules>
                <dependencyConvergence/>
              </rules>
            </configuration>
            <goals>
              <goal>enforce</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.11.3</version>
        <configuration>
          <doctitle>OpenSAML 5.X extension library for the Swedish eID Framework - ${project.version}</doctitle>
          <windowtitle>OpenSAML 5.X extension library for the Swedish eID Framework - ${project.version}</windowtitle>
          <links>
            <link>https://shibboleth.net/api/java-opensaml/${opensaml.version}/</link>
            <link>https://shibboleth.net/api/java-shib-shared/${shib.support.version}/</link>
            <link>https://docs.swedenconnect.se/opensaml-security-ext/javadoc/</link>
            <link>https://docs.swedenconnect.se/opensaml-addons/apidoc/</link>
          </links>
          <detectJavaApiLink>true</detectJavaApiLink>
          <doclint>all,-missing</doclint>
        </configuration>
      </plugin>

    </plugins>

    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
        <filtering>true</filtering>
        <includes>
          <include>**/*.properties</include>
        </includes>
      </testResource>
      <testResource>
        <directory>src/test/resources</directory>
        <filtering>false</filtering>
      </testResource>
    </testResources>

  </build>

  <profiles>

    <profile>
      <id>release</id>

      <build>
        <plugins>

          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <version>0.9.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.8</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </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>
              <execution>
                <id>attach-test-sources</id>
                <goals>
                  <goal>test-jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadoc</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

        </plugins>
      </build>

    </profile>

  </profiles>

</project>
