<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (C) 2015-2017 difi (www.difi.no)
    Copyright (C) 2018-2022 Philip Helger (www.helger.com)
    philip[at]helger[dot]com

    This Source Code Form is subject to the terms of the
    Mozilla Public License, v. 2.0.
    If a copy of the MPL was not distributed
    with this file, You can obtain one at
    https://mozilla.org/MPL/2.0/

-->
<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>com.helger</groupId>
    <artifactId>parent-pom</artifactId>
    <version>2.0.0</version>
  </parent>

  <artifactId>ph-asic</artifactId>
  <version>2.0.0</version>
  <packaging>bundle</packaging>
  <name>ph-asic</name>
  <description>Generic implementation of ASiC-E archives in accordance with ETSI 102 918 v1.3.1.</description>
  <url>https://github.com/phax/ph-asic</url>
  <inceptionYear>2018</inceptionYear>

  <scm>
    <connection>scm:git:git@github.com:phax/ph-asic.git</connection>
    <developerConnection>scm:git:git@github.com:phax/ph-asic.git</developerConnection>
    <url>http://github.com/phax/ph-asic</url>
    <tag>ph-asic-2.0.0</tag>
  </scm>
  
  <properties>
    <jaxb-plugin.group>com.helger.maven</jaxb-plugin.group>
    <jaxb-plugin.artifact>jaxb40-maven-plugin</jaxb-plugin.artifact>
    <jaxb-plugin.version>0.16.0</jaxb-plugin.version>
  </properties>

  <organization>
    <name>Philip Helger</name>
    <url>http://www.helger.com</url>
  </organization>

  <developers>
    <developer>
      <id>phax</id>
      <name>Philip Helger</name>
      <email>philip(at)helger.com</email>
      <url>http://www.helger.com</url>
    </developer>
    <developer>
      <name>Steinar Overbeck Cook</name>
      <email>soc@difi.no</email>
      <organization>Difi</organization>
      <roles>
        <role>Author</role>
      </roles>
    </developer>
    <developer>
      <name>Erlend Klakegg Bergheim</name>
      <email>erlend.klakegg.bergheim@difi.no</email>
      <organization>Difi</organization>
      <roles>
        <role>Author</role>
      </roles>
    </developer>
  </developers>

  <licenses>
    <license>
      <name>Mozilla Public License, Version 2.0</name>
      <url>https://www.mozilla.org/en-US/MPL/2.0/</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.helger.commons</groupId>
        <artifactId>ph-commons-parent-pom</artifactId>
        <version>11.0.0</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>com.helger.xsd</groupId>
        <artifactId>ph-xsds-parent-pom</artifactId>
        <version>3.0.0</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>com.helger.commons</groupId>
      <artifactId>ph-commons</artifactId>
    </dependency>
    <dependency>
      <groupId>com.helger.commons</groupId>
      <artifactId>ph-datetime</artifactId>
    </dependency>
    <dependency>
      <groupId>com.helger.commons</groupId>
      <artifactId>ph-security</artifactId>
    </dependency>
    <dependency>
      <groupId>com.helger.xsd</groupId>
      <artifactId>ph-xsds-xades132</artifactId>
    </dependency>
    <dependency>
      <groupId>com.helger.commons</groupId>
      <artifactId>ph-jaxb</artifactId>
    </dependency>
    <dependency>
      <groupId>com.helger.commons</groupId>
      <artifactId>ph-bc</artifactId>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-impl</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Automatic-Module-Name>com.helger.asic</Automatic-Module-Name>
            <Export-Package>com.helger.asic.*</Export-Package>
            <Import-Package>!javax.annotation.*,*</Import-Package>
          </instructions>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>src/main/resources/schemas/**</exclude>
            <exclude>src/test/resources/asic/**</exclude>
            <exclude>**/LICENSE</exclude>
            <exclude>**/NOTICE</exclude>
            <exclude>**/*.txt</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>${jaxb-plugin.group}</groupId>
        <artifactId>${jaxb-plugin.artifact}</artifactId>
        <version>${jaxb-plugin.version}</version>
        <executions>
          <execution>
            <id>xsd</id>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <schemaDirectory>src/main/resources/schemas</schemaDirectory>
              <bindingDirectory>src/main/jaxb</bindingDirectory>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <extension>true</extension>
          <strict>false</strict>
          <catalog>src/main/jaxb/catalog.txt</catalog>
          <args>
            <arg>-no-header</arg>
            <arg>-Xph-default-locale</arg>
            <arg>en_US</arg>
            <arg>-Xph-annotate</arg>
            <arg>-Xph-fields-private</arg>
            <arg>-Xph-code-quality</arg>
            <arg>-Xph-implements</arg>
            <arg>java.io.Serializable</arg>
            <arg>-Xph-equalshashcode</arg>
            <arg>-Xph-tostring</arg>
            <arg>-Xph-list-extension</arg>
            <arg>-Xph-csu</arg>
            <arg>-Xph-cloneable2</arg>
            <arg>-Xph-value-extender</arg>
            <arg>-Xph-offset-dt-extension</arg>
          </args>
          <episodes>
            <episode>
              <groupId>com.helger.xsd</groupId>
              <artifactId>ph-xsds-xmldsig</artifactId>
            </episode>
            <episode>
              <groupId>com.helger.xsd</groupId>
              <artifactId>ph-xsds-xades132</artifactId>
            </episode>
            <episode>
              <groupId>com.helger.xsd</groupId>
              <artifactId>ph-xsds-ccts-cct-schemamodule</artifactId>
            </episode>
          </episodes>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>com.helger</groupId>
            <artifactId>ph-jaxb-plugin</artifactId>
            <version>4.0.0</version>
          </dependency>
        </dependencies>
      </plugin>
      <!-- Delete the directory with only ObjectFactory 
           Source: http://stackoverflow.com/questions/32635137
      -->
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>process-sources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <delete dir="${basedir}/target/generated-sources/xjc/com/helger/xsds/" />
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <source>8</source>
        </configuration>
      </plugin> 
    </plugins>
  </build>
</project>
