<?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>

    <parent>
        <groupId>network.oxalis.peppol</groupId>
        <artifactId>peppol-specifications</artifactId>
        <version>2.2.0</version>
    </parent>

    <artifactId>peppol-busdox</artifactId>

    <name>Peppol adopted specifications :: Busdox</name>
    <description>Peppol Busdox artifact</description>
    <url>https://github.com/OxalisCommunity/peppol-specifications/tree/master/commons-bdx</url>

    <scm>
        <tag>peppol-specifications-2.2.0</tag>
        <url>https://github.com/OxalisCommunity/peppol-specifications</url>
        <connection>scm:git:git@github.com:OxalisCommunity/peppol-specifications.git</connection>
        <developerConnection>scm:git:git@github.com:OxalisCommunity/peppol-specifications.git</developerConnection>
    </scm>

    <issueManagement>
        <url>https://github.com/OxalisCommunity/peppol-specifications/issues</url>
        <system>GitHub Issues</system>
    </issueManagement>

    <organization>
        <name>NorStella</name>
        <url>https://en.norstella.no/</url>
    </organization>

    <developers>
        <developer>
            <name>Arun Kumar</name>
            <email>arun.kaundal@gmail.com</email>
            <organization>Norstella</organization>
            <roles>
                <role>Oxalis Technical Expert</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>European Union Public Licence (EUPL v.1.1)</name>
            <url>https://joinup.ec.europa.eu/community/eupl/og_page/european-union-public-licence-eupl-v11</url>
            <distribution>repo</distribution>
        </license>
        <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>

    <dependencies>
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>jakarta.xml.ws</groupId>
            <artifactId>jakarta.xml.ws-api</artifactId>
        </dependency>
        <dependency>
            <groupId>jakarta.jws</groupId>
            <artifactId>jakarta.jws-api</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.jvnet.jaxb2.maven2</groupId>
                <artifactId>maven-jaxb2-plugin</artifactId>
                <version>0.14.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <encoding>${java.encoding}</encoding>
                            <generateDirectory>target/generated-sources/xjc/</generateDirectory>
                            <schemaDirectory>${basedir}/src/main/xsd</schemaDirectory>
                            <schemaIncludes>
                                <include>*.xsd</include>
                            </schemaIncludes>
                            <bindingDirectory>${basedir}/src/main/xjb</bindingDirectory>
                            <bindingIncludes>
                                <include>*.xjb</include>
                            </bindingIncludes>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>jakarta.xml.bind</groupId>
                        <artifactId>jakarta.xml.bind-api</artifactId>
                        <version>2.3.3</version>
                    </dependency>
                    <dependency>
                        <groupId>com.sun.xml.bind</groupId>
                        <artifactId>jaxb-impl</artifactId>
                        <version>2.3.3</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>com.sun.xml.ws</groupId>
                <artifactId>jaxws-maven-plugin</artifactId>
                <version>2.3.5</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>
                            <encoding>${java.encoding}</encoding>
                            <wsdlFiles>
                                <wsdlFile>ManageBusinessIdentifierService-1.0.wsdl</wsdlFile>
                            </wsdlFiles>
                            <wsdlLocation>META-INF/ManageBusinessIdentifierService-1.0.wsdl</wsdlLocation>
                            <staleFile>${project.build.directory}/stale/.stale-wsimport1</staleFile>
                            <bindingDirectory>src/main/xjb</bindingDirectory>
                            <bindingFiles>
                                <bindingFile>bindings-identifier.xml</bindingFile>
                            </bindingFiles>
                        </configuration>
                    </execution>
                    <execution>
                        <id>wsimport2</id>
                        <goals>
                            <goal>wsimport</goal>
                        </goals>
                        <configuration>
                            <encoding>${java.encoding}</encoding>
                            <wsdlFiles>
                                <wsdlFile>ManageServiceMetadataService-1.0.wsdl</wsdlFile>
                            </wsdlFiles>
                            <wsdlLocation>META-INF/ManageServiceMetadataService-1.0.wsdl</wsdlLocation>
                            <staleFile>${project.build.directory}/stale/.stale-wsimport2</staleFile>
                            <bindingDirectory>src/main/xjb</bindingDirectory>
                            <bindingFiles>
                                <bindingFile>bindings-metadata.xml</bindingFile>
                            </bindingFiles>
                        </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.3.5</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

</project>