<?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>no.difi.vefa</groupId>
    <artifactId>commons-busdox</artifactId>
    <version>0.9.0</version>

    <name>Busdox</name>
    <description>Busdox artifacts for Java.</description>
    <url>https://github.com/difi/vefa-commons-libs/tree/master/commons-busdox</url>

    <scm>
        <tag>HEAD</tag>
        <url>https://github.com/difi/vefa-commons-libs</url>
        <connection>scm:git:https://github.com/difi/vefa-commons-libs.git</connection>
        <developerConnection>scm:git:git@github.com:difi/vefa-commons-libs.git</developerConnection>
    </scm>

    <issueManagement>
        <url>https://github.com/difi/vefa-commons-libs/issues</url>
        <system>GitHub Issues</system>
    </issueManagement>

    <organization>
        <name>Norwegian Agency for Public Management and eGovernment (Difi)</name>
        <url>http://www.difi.no/</url>
    </organization>

    <developers>
        <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 1.1</name>
            <distribution>repo</distribution>
        </license>
        <license>
            <name>EUPL Version 1.1</name>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <properties>
        <java.encoding>UTF-8</java.encoding>
        <java.version>1.6</java.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <encoding>${java.encoding}</encoding>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <encoding>${java.encoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jaxb2-maven-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <id>xjc</id>
                        <goals>
                            <goal>xjc</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <target>2.1</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jvnet.jax-ws-commons</groupId>
                <artifactId>jaxws-maven-plugin</artifactId>
                <version>2.2</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>META-INF/ManageBusinessIdentifierService-1.0.wsdl</wsdlLocation>
                            <staleFile>${project.build.directory}/stale/.stale-wsimport1</staleFile>
                        </configuration>
                    </execution>
                    <execution>
                        <id>wsimport2</id>
                        <goals>
                            <goal>wsimport</goal>
                        </goals>
                        <configuration>
                            <wsdlFiles>
                                <wsdlFile>ManageServiceMetadataService-1.0.wsdl</wsdlFile>
                            </wsdlFiles>
                            <wsdlLocation>META-INF/ManageServiceMetadataService-1.0.wsdl</wsdlLocation>
                            <staleFile>${project.build.directory}/stale/.stale-wsimport2</staleFile>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <wsdlDirectory>src/main/xsd</wsdlDirectory>
                    <bindingDirectory>src/main/xjb</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/jaxb</sourceDestDir>
                    <xjcArgs>
                        <xjcArg>-no-header</xjcArg>
                    </xjcArgs>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>com.sun.xml.ws</groupId>
                        <artifactId>jaxws-tools</artifactId>
                        <version>2.2.10</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <id>package-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.3</version>
                <executions>
                    <execution>
                        <id>package-javadoc</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <encoding>${java.encoding}</encoding>
                    <!-- <excludePackageNames>org.busdox.*:org.w3.*:org.oasis_open.*</excludePackageNames> -->
                    <failOnError>false</failOnError>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-release-plugin</artifactId>
                        <version>2.5.2</version>
                    </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>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>