<?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>se.swedenconnect.opensaml</groupId>
  <artifactId>opensaml-security-ext</artifactId>
  <packaging>jar</packaging>
  <version>4.0.0</version>

  <name>Sweden Connect :: OpenSAML Security Extensions</name>
  <description>Security and crypto extension library for OpenSAML 5.X</description>
  <url>https://github.com/swedenconnect/opensaml-security-ext</url>

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

  <scm>
    <connection>scm:https://github.com/swedenconnect/opensaml-security-ext.git</connection>
    <developerConnection>scm:https://github.com/swedenconnect/opensaml-security-ext.git</developerConnection>
    <url>https://github.com/swedenconnect/opensaml-security-ext/tree/master</url>
  </scm>

  <developers>
    <developer>
      <name>Stefan Santesson</name>
      <email>stefan@idsec.se</email>
      <organization>IDsec Solutions AB</organization>
      <organizationUrl>https://www.idsec.se</organizationUrl>
    </developer>
    <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.0.0</opensaml.version>
    <shib.support.version>9.0.0</shib.support.version>
    
    <bc.version>1.76</bc.version>    
    <slf4j.version>2.0.9</slf4j.version>
    <jackson.version>2.15.2</jackson.version>
    <junit.version>5.10.0</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>

  <distributionManagement>
    <repository>
    <id>ossrh</id>
    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>
  
  <dependencyManagement>
    <dependencies>
      
      <!-- 
        The OpenSAML team obviously doesn't check for dependency convergence errors.
        The below dependencies are included to avoid such errors.
      --> 
      
      <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.16.0</version>
      </dependency>
      
      <dependency>
        <groupId>org.apache.httpcomponents.core5</groupId>
        <artifactId>httpcore5</artifactId>
        <version>5.2.2</version>
      </dependency>
    
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>${jackson.version}</version>
      </dependency>
      
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>${jackson.version}</version>
      </dependency>
          
    </dependencies>  
  </dependencyManagement>
  
  <dependencies>
    
    <!-- Slf4j -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
      
    <!-- Bouncy Castle -->    
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcprov-jdk18on</artifactId>
      <version>${bc.version}</version>
    </dependency>
    
    <!-- OpenSAML -->
    <dependency>
      <groupId>org.opensaml</groupId>
      <artifactId>opensaml-core-api</artifactId>
      <version>${opensaml.version}</version>
    </dependency>

    <dependency>
      <groupId>org.opensaml</groupId>
      <artifactId>opensaml-core-impl</artifactId>
      <version>${opensaml.version}</version>
    </dependency>

    <dependency>
      <groupId>org.opensaml</groupId>
      <artifactId>opensaml-saml-api</artifactId>
      <version>${opensaml.version}</version>
    </dependency>
    
    <dependency>
      <groupId>org.opensaml</groupId>
      <artifactId>opensaml-saml-impl</artifactId>
      <version>${opensaml.version}</version>
      <exclusions>
        <exclusion>
          <!-- No! We don't want Velocity anywhere near our code ... -->
          <groupId>org.apache.velocity</groupId>
          <artifactId>velocity-engine-core</artifactId>
        </exclusion>
        <exclusion>
          <groupId>net.shibboleth</groupId>
          <artifactId>shib-velocity</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

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

    <dependency>
      <groupId>org.opensaml</groupId>
      <artifactId>opensaml-security-impl</artifactId>
      <version>${opensaml.version}</version>
    </dependency>

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

    <dependency>
      <groupId>org.opensaml</groupId>
      <artifactId>opensaml-xmlsec-impl</artifactId>
      <version>${opensaml.version}</version>
    </dependency>
        
    <dependency>
      <groupId>net.shibboleth</groupId>
      <artifactId>shib-support</artifactId>
      <version>${shib.support.version}</version>
    </dependency>

    <!-- For testing -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>${slf4j.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.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>5.5.0</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
      <version>6.0.12</version>
      <scope>test</scope>
      <type>jar</type>
    </dependency>
     
  </dependencies>

  <build>
    <plugins>

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

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

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>3.4.5</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>4.0.0-M8</version>
      </plugin>

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

    </plugins>
  </build>

  <profiles>

    <profile>
      <id>release</id>

      <!-- See http://central.sonatype.org/pages/apache-maven.html for setup -->

      <build>
        <plugins>

          <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>false</autoReleaseAfterClose>
              <!--
                Allows manual inspection of the staging repo before deploying
                it to the central repo.
                Use 'mvn nexus-staging:release -Prelease' to release and
                'mvn nexus-staging:drop' to abort.
               -->
            </configuration>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.1.0</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.0</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>
            <version>3.6.0</version>
            <executions>
              <execution>
                <id>attach-javadoc</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <doctitle>OpenSAML 5.x Security Extensions - ${project.version}</doctitle>
              <windowtitle>OpenSAML 5.x Security Extensions - ${project.version}</windowtitle>
              <detectJavaApiLink>true</detectJavaApiLink>
              <links>
                <link>https://build.shibboleth.net/nexus/content/sites/site/java-opensaml/${opensaml.version}/apidocs/</link>
                <link>https://build.shibboleth.net/nexus/content/sites/site/java-shib-shared/${shib.support.version}/apidocs/</link>
              </links>
              <doclint>all,-missing</doclint>
            </configuration>
          </plugin>

        </plugins>
      </build>

    </profile>

  </profiles>

</project>
