<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>com.axway.ats.framework.agent.webapp</groupId>
        <artifactId>ats-agent-webapp</artifactId>
        <version>4.0.0</version>
    </parent>

    <artifactId>ats-agent-webapp-client</artifactId>
    <name>ATS-Agent-WebApp-Client</name>

    <build>
        <resources>
            <resource>
                <directory>${basedir}/src/main/resources</directory>
            </resource>
            <resource>
                <directory>${project.build.directory}/generated-resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.jvnet.jax-ws-commons</groupId>
                <artifactId>jaxws-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>wsimport</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <packageName>com.axway.ats.agent.webapp.client</packageName>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-generated-sources</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/generated-sources/wsimport</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack-agent-server-resources</id>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <phase>generate-resources</phase>
                        <configuration>
                            <outputDirectory>${project.build.directory}/generated-resources</outputDirectory>
                            <includeGroupIds>${project.groupId}</includeGroupIds>
                            <includeArtifacIds>ats-agent-webapp-server</includeArtifacIds>
                            <includes>META-INF/wsdl/**</includes>
                            <excludeTransitive>true</excludeTransitive>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Use endorsed with JAX-WS 2.2 on Java 6 -->
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <!-- <source> and <target> default to the ones defined in ats-framework parent -->
                    <compilerArguments>
                        <endorseddirs>${project.build.directory}/endorsed</endorseddirs>
                    </compilerArguments>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/endorsed</outputDirectory>
                            <silent>true</silent>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.glassfish.metro</groupId>
                                    <artifactId>webservices-api</artifactId>
                                    <version>2.1.1</version>
                                    <type>jar</type>
                                </artifactItem>
                                <!-- Alternative with these 2 artifacts part of metro 2.1.1 APIs. They are not found in Axway repositories
                                 1. <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId>
                                        <version>2.2.4-1</version> <type>jar</type>
                                 2.   <artifactItem> <groupId>javax.xml.ws</groupId> <artifactId>jaxws-api</artifactId>
                                    <version>2.2.5</version> <type>jar</type> </artifactItem> -->
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>com.axway.ats.framework.agent</groupId>
            <artifactId>ats-agent-core</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.axway.ats.framework.agent.webapp</groupId>
            <artifactId>ats-agent-webapp-server</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.ws</groupId>
            <artifactId>jaxws-rt</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.easymock</groupId>
            <artifactId>easymock</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-junit4</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-api-easymock</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
