<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (C) 2015-2019 Philip Helger (www.helger.com)
    philip[at]helger[dot]com

    The Original Code is Copyright The PEPPOL project (http://www.peppol.eu)

    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 http://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>peppol-commons-parent-pom</artifactId>
    <version>7.0.2</version>
  </parent>
  <artifactId>peppol-sml-client</artifactId>
  <packaging>bundle</packaging>
  <name>peppol-sml-client</name>
  <description>PEPPOL SML client</description>
  <url>https://github.com/phax/peppol-commons/peppol-sml-client</url>
  <inceptionYear>2015</inceptionYear>
  <licenses>
    <license>
      <name>MPL 2.0</name>
      <url>http://mozilla.org/MPL/2.0/</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <organization>
    <name>Philip Helger</name>
    <url>http://www.helger.com</url>
  </organization>

  <developers>
    <developer>
      <id>philip</id>
      <name>Philip Helger</name>
      <email>ph(at)helger.com</email>
      <url>http://www.helger.com</url>
    </developer>
  </developers>

  <properties>
    <jaxws-plugin.group>com.sun.xml.ws</jaxws-plugin.group>
    <jaxws-plugin.version>2.3.2</jaxws-plugin.version>
    <!--
    <jaxws-plugin.group>org.codehaus.mojo</jaxws-plugin.group>
    <jaxws-plugin.version>2.5</jaxws-plugin.version>
    <jaxws-plugin.group>com.helger.maven</jaxws-plugin.group>
    <jaxws-plugin.version>2.6.1</jaxws-plugin.version>
    -->
  </properties>
  
  <dependencies>
    <dependency>
      <groupId>com.helger</groupId>
      <artifactId>peppol-commons</artifactId>
    </dependency>
    <dependency>
      <groupId>com.helger</groupId>
      <artifactId>ph-datetime</artifactId>
    </dependency>
    <dependency>
      <groupId>com.helger</groupId>
      <artifactId>ph-wsclient</artifactId>
    </dependency>
    
    <dependency>
      <groupId>com.helger</groupId>
      <artifactId>ph-web</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>dnsjava</groupId>
      <artifactId>dnsjava</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</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.peppol.smlclient</Automatic-Module-Name>
            <Export-Package>com.helger.peppol.smlclient.*</Export-Package>
            <Import-Package>!javax.annotation.*,*</Import-Package>
          </instructions>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>**/NOTICE</exclude>
            <exclude>**/LICENSE</exclude>
            <exclude>**/*.episode</exclude>
            <exclude>**/*.jks</exclude>
            <exclude>src/main/resources/WEB-INF/wsdl/BDMSL*</exclude>
            <exclude>src/main/resources/WEB-INF/wsdl/**</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <doclint>none</doclint>
        </configuration>
      </plugin>
      <plugin>
        <groupId>${jaxws-plugin.group}</groupId>
        <artifactId>jaxws-maven-plugin</artifactId>
        <version>${jaxws-plugin.version}</version>
        <executions>
          <!-- 
            Use one execution per WSDL file, as the wsdlLocation can specify only one file at a time. 
            The wsdlLocation is the location how the WSDL file will be referenced in the code 
             (using class.getResource). 
            Also important: use a different stale file for each WSDL file! 
            Also important: path must be "/WEB-INF/wsdl" because this is how the deployment descriptor needs it.
              It must be absolute because class.getResource is used and we therefore need an asbolute path! 
          -->
          <execution>
            <id>wsimport1</id>
            <goals>
              <goal>wsimport</goal>
            </goals>
            <configuration>
              <wsdlFiles>
                <wsdlFile>ManageBusinessIdentifierService-1.0.wsdl</wsdlFile>
              </wsdlFiles>
              <wsdlLocation>/WEB-INF/wsdl/ManageBusinessIdentifierService-1.0.wsdl</wsdlLocation>
              <staleFile>${project.build.directory}/stale/.stale-wsimport1</staleFile>
              <packageName>com.helger.peppol.smlclient.participant</packageName>
            </configuration>
          </execution>
          <execution>
            <id>wsimport2</id>
            <goals>
              <goal>wsimport</goal>
            </goals>
            <configuration>
              <wsdlFiles>
                <wsdlFile>ManageServiceMetadataService-1.0.wsdl</wsdlFile>
              </wsdlFiles>
              <wsdlLocation>/WEB-INF/wsdl/ManageServiceMetadataService-1.0.wsdl</wsdlLocation>
              <staleFile>${project.build.directory}/stale/.stale-wsimport2</staleFile>
              <packageName>com.helger.peppol.smlclient.smp</packageName>
            </configuration>
          </execution>
          <execution>
            <id>wsimport3</id>
            <goals>
              <goal>wsimport</goal>
            </goals>
            <configuration>
              <wsdlFiles>
                <wsdlFile>BDMSLService-1.0.wsdl</wsdlFile>
              </wsdlFiles>
              <wsdlLocation>/WEB-INF/wsdl/BDMSLService-1.0.wsdl</wsdlLocation>
              <staleFile>${project.build.directory}/stale/.stale-wsimport3</staleFile>
              <packageName>com.helger.peppol.smlclient.bdmsl</packageName>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <wsdlDirectory>src/main/resources/WEB-INF/wsdl</wsdlDirectory>
          <bindingDirectory>src/main/jaxb</bindingDirectory>
          <!-- 
            We need to use the same output directory as the JAXB call, because 
            both wsimport and JAXB are creating code for the Identifiers-x.y.xsd file!
          -->
          <sourceDestDir>target/generated-sources/xjc</sourceDestDir>
          <extension>true</extension>
          <verbose>true</verbose>
          <target>2.1</target>
          <args>
            <arg>-ph-csu</arg>
          </args>
          <xjcArgs>
            <xjcArg>-no-header</xjcArg>
            <xjcArg>-Xph-default-locale</xjcArg>
            <xjcArg>en_US</xjcArg>
            <xjcArg>-Xph-annotate</xjcArg>
            <xjcArg>-Xph-fields-private</xjcArg>
            <xjcArg>-Xph-code-quality</xjcArg>
            <xjcArg>-Xph-implements</xjcArg>
            <xjcArg>java.io.Serializable</xjcArg>
            <xjcArg>-Xph-equalshashcode</xjcArg>
            <xjcArg>-Xph-tostring</xjcArg>
            <xjcArg>-Xph-list-extension</xjcArg>
            <xjcArg>-extension</xjcArg>
            <xjcArg>-b</xjcArg>
            <xjcArg>src/main/jaxb/peppol-commons.episode</xjcArg>
          </xjcArgs>
          <!-- Required to work with a JDK 1.8 JVM! -->
          <vmArgs>
            <vmArg>-Djavax.xml.accessExternalSchema=all</vmArg>
          </vmArgs>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>com.helger</groupId>
            <artifactId>ph-jaxb22-plugin</artifactId>
            <version>2.3.2.2</version>
          </dependency>
          <dependency>
            <groupId>com.helger</groupId>
            <artifactId>ph-wsimport-plugin</artifactId>
            <version>2.3.1.3</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>
</project>
