<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>
  
  <parent>
    <groupId>se.digg.dgc</groupId>
    <artifactId>dgc-parent</artifactId>
    <version>1.0.1</version>
  </parent>  

  <artifactId>dgc-create-validate</artifactId>

  <name>DIGG :: EU Digital Covid Certificate :: Issuance and Validation</name>
  <description>Issuance and validation of EU Digital Covid Certificates</description>
  <url>https://github.com/diggsweden/dgc-java</url>
  
  <licenses>
    <license>
      <name>MIT License</name>
      <url>http://www.opensource.org/licenses/mit-license.php</url>
      <distribution>repo</distribution>
    </license>
  </licenses>  

  <scm>
    <connection>scm:https://github.com/diggsweden/dgc-java.git</connection>
    <developerConnection>scm:https://github.com/diggsweden/dgc-java.git</developerConnection>
    <url>https://github.com/diggsweden/dgc-java/tree/master</url>
  </scm>

  <developers>
    <developer>
      <name>Martin Lindström</name>
      <email>martin.lindstrom@idsec.se</email>
    </developer>
    <developer>
      <name>Henrik Bengtsson</name>
      <email>extern.henrik.bengtsson@digg.se</email>
    </developer>
    <developer>
      <name>Henric Norlander</name>
      <email>extern.henric.norlander@digg.se</email>
    </developer>
  </developers>
  
  <distributionManagement>
    <repository>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/content/groups/staging/</url>
    </repository>
  </distributionManagement>  

  <properties>
    <!-- Versions on dependencies -->
    <bouncy-castle.version>1.68</bouncy-castle.version>
    <xmlsec.version>2.2.1</xmlsec.version>    
    <zxing.version>3.4.1</zxing.version>
  </properties>

  <dependencies>
  
    <!-- 
      Note that the dgc-schema dependency has provided-scope.
      The reason for this is that the schema may change more frequently and we don't want
      to hardwire a version dependency to it.
     -->
    <dependency>
      <groupId>se.digg.dgc</groupId>
      <artifactId>dgc-schema</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>
  
    <dependency>
      <groupId>javax.validation</groupId>
      <artifactId>validation-api</artifactId>
    </dependency>

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

    <dependency>
      <groupId>com.fasterxml.jackson.dataformat</groupId>
      <artifactId>jackson-dataformat-cbor</artifactId>
    </dependency>
    
    <dependency>
      <groupId>com.fasterxml.jackson.datatype</groupId>
      <artifactId>jackson-datatype-jsr310</artifactId>
    </dependency>    

    <!-- CBOR and COSE -->
    <dependency>
      <groupId>com.upokecenter</groupId>
      <artifactId>cbor</artifactId>
    </dependency>

    <dependency>
      <groupId>com.nimbusds</groupId>
      <artifactId>nimbus-jose-jwt</artifactId>
      <version>8.20.2</version>
    </dependency>
    
    <!-- Barcodes -->
    <dependency>
      <groupId>com.google.zxing</groupId>
      <artifactId>core</artifactId>
      <version>[${zxing.version},)</version>
      <optional>true</optional>
    </dependency>
    
    <dependency>
      <groupId>com.google.zxing</groupId>
      <artifactId>javase</artifactId>
      <version>[${zxing.version},)</version>
      <optional>true</optional>
    </dependency>

    <!-- Security -->
    <dependency>
      <groupId>org.apache.santuario</groupId>
      <artifactId>xmlsec</artifactId>
      <version>${xmlsec.version}</version>
    </dependency>

    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcprov-jdk15on</artifactId>
      <version>${bouncy-castle.version}</version>
    </dependency>
    
    <!-- Include those to make full use of PkiCredentials support -->
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
      <version>[5.0.0.RELEASE,)</version>
      <optional>true</optional>  
    </dependency>
    
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
      <version>[5.0.0.RELEASE,)</version>
      <optional>true</optional>
    </dependency>
            
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
      <version>[5.0.0.RELEASE,)</version>
      <optional>true</optional>
    </dependency>
    
  </dependencies>
  
  <profiles>
  
    <profile>
      <id>default</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      
      <properties>
        <java.version>11</java.version>
        <credentials-support.version>1.0.1</credentials-support.version>
      </properties>
      
      <dependencies>
      
        <dependency>
          <groupId>se.swedenconnect.security</groupId>
          <artifactId>credentials-support</artifactId>
          <version>${credentials-support.version}</version>
          <exclusions>
            <exclusion>
              <groupId>org.springframework</groupId>
              <artifactId>spring-core</artifactId>
            </exclusion>        
            <exclusion>
              <groupId>org.springframework</groupId>
              <artifactId>spring-beans</artifactId>
            </exclusion>
            <exclusion>
              <groupId>org.springframework</groupId>
              <artifactId>spring-context</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
                
      </dependencies>
      
      
    </profile>  
  
    <profile>
      <id>j8-build</id>
      
      <properties>
        <java.version>1.8</java.version>
      </properties>

      <build>
        <finalName>${project.artifactId}-java8-${project.version}</finalName>
        
        <plugins>
        
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>3.2.0</version>
            <executions>
              <execution>
                <phase>generate-sources</phase>
                <goals>
                  <goal>add-source</goal>
                </goals>
                <configuration>
                  <sources>
                    <source>src/main/j8-src</source>
                  </sources>
                </configuration>
              </execution>
            </executions>
          </plugin>              
        </plugins>        
      </build>
      
    </profile>  

    <profile>
      <id>release</id>

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

      <build>
        <plugins>

          <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>
            <configuration>
              <doctitle>EU Digital Covid Certificate - Issuance and Validation - ${project.version}</doctitle>
              <windowtitle>EU Digital Covid Certificate - Issuance and Validation - ${project.version}</windowtitle>
              <detectJavaApiLink>true</detectJavaApiLink>
              <additionalparam>-Xdoclint:all -Xdoclint:-missing</additionalparam>
              <additionalOptions>-Xdoclint:all -Xdoclint:-missing</additionalOptions>
              <additionalJOptions>
                <additionalJOption>-Xdoclint:all</additionalJOption>
                <additionalJOption>-Xdoclint:-missing</additionalJOption>
              </additionalJOptions>
              <links>
                <link>https://docs.spring.io/spring-framework/docs/current/javadoc-api/</link>
                <link>https://docs.swedenconnect.se/credentials-support/apidoc/</link>
                <link>https://zxing.github.io/zxing/apidocs/</link>
                <link>https://diggsweden.github.io/dgc-java/javadoc/dgc-schema/</link>
              </links>
            </configuration>
          </plugin>

        </plugins>
      </build>

    </profile>

  </profiles>  

</project>
