<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.digg.dgc</groupId>
  <artifactId>dgc-parent</artifactId>
  <version>1.0.2</version>
  <packaging>pom</packaging>

  <name>DIGG :: EU Digital Covid Certificate :: DCC Java</name>
  <description>Schema representation, 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>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>        
    
    <!-- Versions on dependencies -->
    <jackson.version>2.13.2</jackson.version>
    <slf4j.version>1.7.30</slf4j.version>
    <junit.version>4.13.1</junit.version>
  </properties>
  
  <dependencyManagement>
  
    <dependencies>
  
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      
      <dependency>
        <groupId>javax.validation</groupId>
        <artifactId>validation-api</artifactId>
        <version>2.0.1.Final</version>
      </dependency>
      
      <!-- Jackson -->
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.13.2.1</version>
      </dependency>
  
      <dependency>
        <groupId>com.fasterxml.jackson.dataformat</groupId>
        <artifactId>jackson-dataformat-cbor</artifactId>
        <version>${jackson.version}</version>
      </dependency>
      
      <dependency>
        <groupId>com.fasterxml.jackson.datatype</groupId>
        <artifactId>jackson-datatype-jsr310</artifactId>
        <version>${jackson.version}</version>
      </dependency>
      
      <!-- CBOR and COSE -->
      <dependency>
        <groupId>com.upokecenter</groupId>
        <artifactId>cbor</artifactId>
        <version>4.5.2</version>
      </dependency>
      
      <!-- Test -->
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
      </dependency>
              
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-nop</artifactId>
        <version>${slf4j.version}</version>
        <scope>test</scope>
      </dependency>
  
    </dependencies>
  
  </dependencyManagement>

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

    <!-- For testing -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </dependency>
        
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-nop</artifactId>
    </dependency>
        
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.8.0</version>
      <scope>test</scope>
    </dependency>
    

  </dependencies>

  <build>
  
    <plugins>

      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.10.1</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
        </configuration>
      </plugin>

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

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

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

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

  </build>
  
  <profiles>
  
    <profile>
      <id>default</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      
      <properties>
        <java.version>11</java.version>
      </properties>
    </profile>
    
    <profile>
      <id>j8-build</id>
      
      <properties>
        <java.version>1.8</java.version>
      </properties>
      
      <build>
        <finalName>${project.artifactId}-java8-${project.version}</finalName>
      </build>
      
    </profile>

    <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.12</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://s01.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>1.6</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.2.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.3.2</version>
            <executions>
              <execution>
                <id>attach-javadoc</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <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>
            </configuration>
          </plugin>

        </plugins>
      </build>

    </profile>

  </profiles>
  
  <modules>
    <module>schema</module>
    <module>create-validate</module>
  </modules>
  
</project>
