<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Distribution License v. 1.0, which is available at
    http://www.eclipse.org/org/documents/edl-v10.php.

    SPDX-License-Identifier: BSD-3-Clause

-->

<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.sun.xml.ws</groupId>
        <artifactId>bundles</artifactId>
        <version>2.3.5</version>
    </parent>

    <groupId>com.sun.xml.ws</groupId>
    <artifactId>jaxws-ri</artifactId>
    <version>2.3.5</version>

    <packaging>pom</packaging>
    <name>JAX-WS RI Standalone Zipped Bundle</name>
    <description>Open source Reference Implementation of JSR-224: Java API for XML Web Services Distribution Bundle</description>

    <dependencies>
<!--        <dependency>
            <groupId>jakarta.annotation</groupId>
            <artifactId>jakarta.annotation-api</artifactId>
        </dependency>-->
        <dependency>
            <groupId>com.sun.org.apache.xml.internal</groupId>
            <artifactId>resolver</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>jaxws-rt</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>jaxws-tools</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>jaxws-eclipselink-plugin</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>sdo-eclipselink-plugin</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>release-documentation</artifactId>
            <version>${project.version}</version>
            <type>zip</type>
            <classifier>docbook</classifier>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>samples</artifactId>
            <version>${project.version}</version>
            <type>zip</type>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <id>copy-resources</id>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/filtered</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${project.basedir}/src/main/resources</directory>
                                    <filtering>true</filtering>
                                    <includes>
                                        <include>build.xml</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <finalName>jaxws-ri</finalName>
                            <appendAssemblyId>false</appendAssemblyId>
                            <descriptors>
                                <descriptor>src/main/assembly/assembly.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>stage</id>
                        <phase>package</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <excludes>**/module-info.java</excludes>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>${project.groupId}</groupId>
                                    <artifactId>${project.artifactId}</artifactId>
                                    <version>${project.version}</version>
                                    <type>zip</type>
                                    <outputDirectory>${project.build.directory}/stage</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>coverage</id>
            <activation>
                <property>
                    <name>jacoco-build</name>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.jacoco</groupId>
                    <artifactId>org.jacoco.core</artifactId>
                    <version>${jacoco.version}</version>
                </dependency>
                <dependency>
                    <groupId>org.jacoco</groupId>
                    <artifactId>org.jacoco.report</artifactId>
                    <version>${jacoco.version}</version>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-jacoco-lib</id>
                                <phase>process-test-sources</phase>
                                <goals>
                                    <goal>copy</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${project.build.directory}/lib</outputDirectory>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>org.jacoco</groupId>
                                            <artifactId>org.jacoco.ant</artifactId>
                                            <type>jar</type>
                                        </artifactItem>
                                        <artifactItem>
                                            <groupId>org.jacoco</groupId>
                                            <artifactId>org.jacoco.core</artifactId>
                                            <type>jar</type>
                                        </artifactItem>
                                        <artifactItem>
                                            <groupId>org.jacoco</groupId>
                                            <artifactId>org.jacoco.report</artifactId>
                                            <type>jar</type>
                                        </artifactItem>
                                        <artifactItem>
                                            <groupId>org.ow2.asm</groupId>
                                            <artifactId>asm</artifactId>
                                            <type>jar</type>
                                            <version>${asm.version}</version>
                                        </artifactItem>
                                        <artifactItem>
                                            <groupId>org.ow2.asm</groupId>
                                            <artifactId>asm-commons</artifactId>
                                            <type>jar</type>
                                            <version>${asm.version}</version>
                                        </artifactItem>
                                        <artifactItem>
                                            <groupId>org.ow2.asm</groupId>
                                            <artifactId>asm-tree</artifactId>
                                            <type>jar</type>
                                            <version>${asm.version}</version>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>instrument-dist-zip</id>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <phase>package</phase>
                                <configuration>
                                    <target xmlns:jacoco="antlib:org.jacoco.ant">
                                        <!--taskdef classpathref="maven.test.classpath" resource="tasks.properties" /-->
                                        <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
                                            <classpath path="target/lib/org.jacoco.ant-0.8.5.jar:target/lib/org.jacoco.core-0.8.5.jar:target/lib/org.jacoco.report-0.8.5.jar:target/lib/asm-7.2.jar:target/lib/asm-commons-7.2.jar:target/lib/asm-tree-7.2.jar" />
                                        </taskdef>
                                        <property name="jaxws-ri.instr.dir" location="${project.build.directory}/jaxws-ri-instrumented"/>
                                        <property name="jaxws-ri.instr.full.name" location="${project.build.directory}/jaxws-ri-instrumented-full.zip"/>
                                        <unzip src="${project.build.directory}/jaxws-ri.zip" dest="${jaxws-ri.instr.dir}"/>
                                        <jacoco:instrument destdir="${jaxws-ri.instr.dir}">
                                            <fileset dir="${jaxws-ri.instr.dir}/jaxws-ri/lib">
                                                <include name="jaxws-rt.jar" />
                                                <include name="jaxws-tools.jar" />
                                                <include name="plugins/*-plugin.jar" />
                                            </fileset>
                                        </jacoco:instrument>
                                        <!--attachartifact file="${jaxws-ri.instr.dir}/jaxws-ri/jacoco/jacoco.exec" type="exec"/-->
                                        <zip destfile="${jaxws-ri.instr.full.name}" basedir="${project.build.directory}/jaxws-ri-instrumented"/>
                                        <attachartifact file="${jaxws-ri.instr.full.name}" classifier="instrumented" type="zip"/>
                                    </target>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
