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

    DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.

    Copyright (c) 2012-2017 Oracle and/or its affiliates. All rights reserved.

    The contents of this file are subject to the terms of either the GNU
    General Public License Version 2 only ("GPL") or the Common Development
    and Distribution License("CDDL") (collectively, the "License").  You
    may not use this file except in compliance with the License.  You can
    obtain a copy of the License at
    https://oss.oracle.com/licenses/CDDL+GPL-1.1
    or LICENSE.txt.  See the License for the specific
    language governing permissions and limitations under the License.

    When distributing the software, include this License Header Notice in each
    file and include the License file at LICENSE.txt.

    GPL Classpath Exception:
    Oracle designates this particular file as subject to the "Classpath"
    exception as provided by Oracle in the GPL Version 2 section of the License
    file that accompanied this code.

    Modifications:
    If applicable, add the following below the License Header, with the fields
    enclosed by brackets [] replaced by your own identifying information:
    "Portions Copyright [year] [name of copyright owner]"

    Contributor(s):
    If you wish your version of this file to be governed by only the CDDL or
    only the GPL Version 2, indicate your decision by adding "[Contributor]
    elects to include this software in this distribution under the [CDDL or GPL
    Version 2] license."  If you don't indicate a single choice of license, a
    recipient has the option to distribute your version of this file under
    either the CDDL, the GPL Version 2 or to extend the choice of license to
    its licensees as provided above.  However, if you add GPL Version 2 code
    and therefore, elected the GPL Version 2 license, then the option applies
    only if the new code is made subject to such option by the copyright
    holder.

-->

<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.0.2</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>jaxws-ri-jdk</artifactId>
    <version>2.3.0.2</version>

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

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

        <!--incorrect source packaging in this version(s), so must be as extra dependencies:-->
        <dependency>
            <groupId>org.glassfish.gmbal</groupId>
            <artifactId>gmbal-api-only-source</artifactId>
        </dependency>
        <dependency>
            <groupId>org.glassfish.external</groupId>
            <artifactId>management-api</artifactId>
        </dependency>

        <!--changing scope to compile to be included into sources-->
        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>javax.annotation-api</artifactId>
            <scope>compile</scope>
        </dependency>

        <!--Dependencies just to compile sources (to verify): -->
        <dependency>
            <groupId>com.sun.org.apache.xml.internal</groupId>
            <artifactId>resolver</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.woodstox</groupId>
            <artifactId>stax2-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.woodstox</groupId>
            <artifactId>woodstox-core-asl</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.ha</groupId>
            <artifactId>ha-api</artifactId>
            <scope>provided</scope>
        </dependency>

    </dependencies>

    <properties>
        <netbeans.hint.jdkPlatform>JDK_9</netbeans.hint.jdkPlatform>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack-sources</id>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <classifier>sources</classifier>
                            <excludeScope>provided</excludeScope>
                            <outputDirectory>target/unpacked-sources</outputDirectory>

                            <excludes>module-info.java,
                                //added after mavenization:,
                                com/sun/xml/ws/transport/httpspi/servlet/,

                                //JAX-WS Patch,
                                com/sun/xml/ws/transport/local/,
                                com/sun/xml/ws/transport/http/servlet/,
                                com/sun/xml/ws/transport/http/client/CookieManager.java,
                                com/sun/xml/ws/transport/http/client/CookiePolicy.java,
                                com/sun/xml/ws/transport/http/client/CookieStore.java,
                                com/sun/xml/ws/transport/http/client/HttpCookie.java,
                                com/sun/xml/ws/transport/http/client/InMemoryCookieStore.java,
                                com/sun/xml/ws/developer/servlet/,
                                com/sun/xml/ws/server/servlet/,
                                com/sun/xml/ws/api/ha/HighAvailabilityProvider.java,
                                com/sun/xml/ws/api/ha/HighAvailabilityProviderException.java,
                                com/sun/xml/ws/developer/Stateful.java,
                                com/sun/xml/ws/developer/StatefulFeature.java,
                                com/sun/xml/ws/developer/StatefulWebServiceManager.java,
                                com/sun/xml/ws/server/StatefulInstanceResolver.java,
                                org/glassfish/ha/,
                                **/com/sun/tools/ws/ant/,
                                com/sun/tools/ws/local/,
                                META-INF/services/com.sun.xml.ws.api.pipe.TransportTubeFactory,
                                META-INF/services/javax.xml.ws.spi.Provider,
                                jaxws-databinding.xsd,
                                jaxws-databinding-translate-namespaces.xml,

                                //JAXB Patch,
                                com/sun/istack/tools/ProtectedTask.java,
                                com/sun/tools/jxc/ApBasedTask.java,
                                com/sun/tools/jxc/SchemaGenTask.java,
                                com/sun/tools/jxc/SchemaGenBase.java,
                                com/sun/tools/xjc/XJCTask.java,
                                com/sun/tools/xjc/XJC2Task.java,
                                com/sun/tools/xjc/XJCBase.java,
                                javax/xml/namespace/QName.java,
                                javax/xml/ws/wsaddressing/package.html,
                                META-INF/services/javax.xml.bind.JAXBContext,
                                com/sun/org/apache/xml/internal/resolver/,
                                com/sun/xml/bind/v2/doc-files/,
                                com/sun/tools/xjc/reader/xmlschema/doc-files/,

                                //JSR-250 Patch,
                                javax/annotation/security/,
                                javax/annotation/sql/,
                                javax/annotation/ManagedBean.java,
                                pom.xml,
                                javax/annotation/package.html,

                                //TODO-Miran: CCC would be created to include this into JDK?,
                                javax/annotation/Priority.java,

                                //SAAJ Patch,
                                META-INF/services/javax.xml.soap.MessageFactory,
                                META-INF/services/javax.xml.soap.MetaFactory,
                                META-INF/services/javax.xml.soap.SOAPConnectionFactory,
                                META-INF/services/javax.xml.soap.SOAPFactory,

                                //Misc Patch,
                                META-INF/MANIFEST.MF,
                                META-INF/LICENSE.txt,
                                purify.xsl,

                                //XJC - rngom = incorrectly packaged source bundle,
                                CompactParseable.java,
                                CompactSyntaxConstants.java,
                                CompactSyntax.java,
                                CompactSyntax.jj,
                                CompactSyntaxTokenManager.java,
                                EOFException.java,
                                EscapeSyntaxException.java,
                                JavaCharStream.java,
                                Messages.properties,
                                ParseException.java,
                                Token.java,
                                TokenMgrError.java,
                                UCode_UCodeESC_CharStream.java,
                                *.rng,
                                com/sun/tools/xjc/reader/dtd/bindinfo/bindingfile.rng,
                                com/sun/tools/xjc/reader/xmlschema/bindinfo/binding.rng,
                                com/sun/tools/jxc/gen/config/config.rng,
                                com/sun/xml/bind/v2/schemagen/xmlschema/xmlschema-for-jaxb.rng,
                                org/kohsuke/rngom/parse/compact/CompactSyntax.jj,
                                META-INF/services/com.sun.xml.ws.spi.db.BindingContextFactory
                            </excludes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>unpack-sources-non-standard-packaging</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>target/unpacked-sources</outputDirectory>
                            <includeGroupIds>org.glassfish.gmbal,org.glassfish.external</includeGroupIds>
                            <excludes>**/**/*.class,**/**/*.swp,META-INF/*,module-info.*</excludes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.12</version>
                <executions>
                    <execution>
                        <id>timestamp-property</id>
                        <goals>
                            <goal>timestamp-property</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <name>current.year</name>
                            <pattern>yyyy</pattern>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- replace default versions of classes with JDK9 -->
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-jdk9-classes</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <move todir="${project.build.directory}/unpacked-sources" overwrite="true" failonerror="false">
                                    <fileset dir="${project.build.directory}/unpacked-sources/META-INF/versions/9">
                                        <include name="**/*.java"/>
                                        <exclude name="com/sun/tools/jxc/SchemaGenTask.java" />
                                        <exclude name="com/sun/tools/xjc/XJC2Task.java" />
                                    </fileset>
                                </move>
                                <delete dir="${project.build.directory}/unpacked-sources/META-INF/versions" verbose="true" failonerror="false"/>
                            </target>
                        </configuration>
                    </execution>
                    <execution>
                        <id>update-version-strings</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <!-- jaxb properties contain ${version} string which has to be updated to appropriate version -->
                                <replaceregexp match="\$\{version\}" replace="${jaxb.version}" flags="gs" byline="true">
                                    <fileset dir="${project.build.directory}/unpacked-sources/com/sun/tools/jxc" includes="*.properties" />
                                    <fileset dir="${project.build.directory}/unpacked-sources/com/sun/tools/xjc" includes="*.properties" />
                                </replaceregexp>
                                <replaceregexp match="Copyright \(c\) 1997\-[0-9]{4}" replace="Copyright (c) 1997-${current.year}" flags="gs" byline="true">
                                    <fileset dir="${project.build.directory}/unpacked-sources/com/sun/tools/jxc" includes="*.properties" />
                                    <fileset dir="${project.build.directory}/unpacked-sources/com/sun/tools/xjc" includes="*.properties" />
                                </replaceregexp>
                                <!-- jaxws properties contain various ${version} strings which has to be updated to appropriate string -->
                                <replaceregexp match="\$\{project.version\}" replace="${project.version}" flags="gs" byline="true">
                                    <fileset dir="${project.build.directory}/unpacked-sources/com/sun/xml/ws/util" includes="version.properties" />
                                </replaceregexp>
                                <replaceregexp match="\$\{jaxws.majorVersion\}" replace="${jaxws.majorVersion}" flags="gs" byline="true">
                                    <fileset dir="${project.build.directory}/unpacked-sources/com/sun/xml/ws/util" includes="version.properties" />
                                </replaceregexp>
                                <replaceregexp match="\$\{jaxws.minorVersion\}" replace="${jaxws.minorVersion}" flags="gs" byline="true">
                                    <fileset dir="${project.build.directory}/unpacked-sources/com/sun/xml/ws/util" includes="version.properties" />
                                </replaceregexp>
                                <replaceregexp match="\$\{jaxws.incrementalVersion\}" replace="${jaxws.incrementalVersion}" flags="gs" byline="true">
                                    <fileset dir="${project.build.directory}/unpacked-sources/com/sun/xml/ws/util" includes="version.properties" />
                                </replaceregexp>
                                <replaceregexp match="\$\{buildNumber\}" replace="${buildNumber}" flags="gs" byline="true">
                                    <fileset dir="${project.build.directory}/unpacked-sources/com/sun/xml/ws/util" includes="version.properties" />
                                </replaceregexp>
                                <replaceregexp match="Copyright \(c\) 2012\-[0-9]{4}" replace="Copyright (c) 2012-${current.year}" flags="gs" byline="true">
                                    <fileset dir="${project.build.directory}/unpacked-sources/com/sun/xml/ws/util" includes="version.properties" />
                                </replaceregexp>

                                <replaceregexp match="\$\{project.version\}" replace="${project.version}" flags="gs" byline="true">
                                    <fileset dir="${project.build.directory}/unpacked-sources/com/sun/tools/ws" includes="version.properties" />
                                </replaceregexp>
                                <replaceregexp match="\$\{jaxws.majorVersion\}" replace="${jaxws.majorVersion}" flags="gs" byline="true">
                                    <fileset dir="${project.build.directory}/unpacked-sources/com/sun/tools/ws" includes="version.properties" />
                                </replaceregexp>
                                <replaceregexp match="\$\{jaxws.minorVersion\}" replace="${jaxws.minorVersion}" flags="gs" byline="true">
                                    <fileset dir="${project.build.directory}/unpacked-sources/com/sun/tools/ws" includes="version.properties" />
                                </replaceregexp>
                                <replaceregexp match="\$\{jaxws.incrementalVersion\}" replace="${jaxws.incrementalVersion}" flags="gs" byline="true">
                                    <fileset dir="${project.build.directory}/unpacked-sources/com/sun/tools/ws" includes="version.properties" />
                                </replaceregexp>
                                <replaceregexp match="\$\{buildNumber\}" replace="${buildNumber}" flags="gs" byline="true">
                                    <fileset dir="${project.build.directory}/unpacked-sources/com/sun/tools/ws" includes="version.properties" />
                                </replaceregexp>
                                <replaceregexp match="Copyright \(c\) 2012\-[0-9]{4}" replace="Copyright (c) 2012-${current.year}" flags="gs" byline="true">
                                    <fileset dir="${project.build.directory}/unpacked-sources/com/sun/tools/ws" includes="version.properties" />
                                </replaceregexp>

                                <replaceregexp match="@@JAXB_JDK_VERSION@@" replace="${jaxb.version}" flags="gs" byline="true">
                                    <fileset dir="${project.build.directory}/unpacked-sources/com/sun/tools/xjc" includes="MessageBundle*.properties" />
                                    <fileset dir="${project.build.directory}/unpacked-sources/com/sun/tools/jxc" includes="MessageBundle*.properties" />
                                </replaceregexp>
                                <replaceregexp match="Copyright \(c\) 1997\-[0-9]{4}" replace="Copyright (c) 1997-${current.year}" flags="gs" byline="true">
                                    <fileset dir="${project.build.directory}/unpacked-sources/com/sun/tools/xjc" includes="MessageBundle*.properties" />
                                    <fileset dir="${project.build.directory}/unpacked-sources/com/sun/tools/jxc" includes="MessageBundle*.properties" />
                                </replaceregexp>
                            </target>
                        </configuration>
                    </execution>
                    <execution>
                        <!-- move jaxws-tubes-default.xml to com/sun/xml/ws/assembler -->
                        <!-- also see MetroConfigLoader.java patching below -->
                        <id>move-jaxws-tubes-default.xml</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <move todir="${project.build.directory}/unpacked-sources/com/sun/xml/ws/assembler">
                                    <fileset dir="${project.build.directory}/unpacked-sources/META-INF">
                                        <include name="jaxws-tubes-default.xml"/>
                                    </fileset>
                                </move>
                            </target>
                        </configuration>
                    </execution>
                    <execution>
                        <!-- licences update, ant so far; TODO: find non-ant solution -->
                        <id>rebrand-sources</id>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <property name="antdir" value="${basedir}/src/main/ant"/>
                                <property name="lic" value="${antdir}/oracle_gpl_2005-2011.txt"/>
                                <taskdef name="licensetool" classname="org.jvnet.licensetool.LicenseToolTask">
                                    <classpath>
                                        <fileset dir=".">
                                            <include name="**/*.jar"/>
                                        </fileset>
                                    </classpath>
                                </taskdef>
                                <macrodef name="prepend">
                                    <attribute name="destfile"/>
                                    <attribute name="srcfile"/>

                                    <sequential>
                                        <concat destfile="target/generated-sources/@{destfile}.temp">
                                            <fileset file="@{srcfile}"/>
                                            <fileset file="target/generated-sources/@{destfile}"/>
                                        </concat>
                                        <move file="target/generated-sources/@{destfile}.temp"
                                              tofile="target/generated-sources/@{destfile}"/>
                                    </sequential>
                                </macrodef>
                                <macrodef name="correct">
                                    <attribute name="includes"/>
                                    <attribute name="copyright"/>
                                    <attribute name="excludes"/>
                                    <sequential>
                                        <taskdef name="licensetool" classname="org.jvnet.licensetool.LicenseToolTask">
                                            <classpath>
                                                <fileset dir="src/main/ant">
                                                    <include name="**/*.jar"/>
                                                </fileset>
                                            </classpath>
                                        </taskdef>
                                        <licensetool srcDir="target/generated-sources"
                                                     validate="false"
                                                     skipdirs=".svn,.cvs,SCCS,.hg"
                                                     copyright="@{copyright}"
                                                     options=""
                                                     dryrun="false"
                                                     startyear="2005"
                                                     endyear="2017"
                                                     verbose="false"
                                                     includes="@{includes}"
                                                     excludes="@{excludes}">
                                        </licensetool>
                                    </sequential>
                                </macrodef>

                                <correct copyright="${lic}" includes="java.xml.ws/javax/xml/soap/" excludes=""/>
                                <correct copyright="${lic}" includes="java.xml.ws/javax/jws/" excludes=""/>
                                <correct copyright="${lic}" includes="java.xml.ws/javax/xml/ws/" excludes=""/>
                                <correct copyright="${lic}" includes="java.xml.bind/javax/xml/bind/" excludes=""/>
                                <correct copyright="${lic}" includes="java.xml.ws.annotation/javax/annotation/"
                                         excludes="java.xml.ws.annotation/javax/annotation/processing"/>
                                <correct copyright="${lic}" includes="java.xml.ws/com/sun/xml/internal/ws/"
                                         excludes="java.xml.ws/com/sun/xml/internal/ws/org/objectweb/asm/"/>
                                <correct copyright="${lic}" includes="java.xml.bind/com/sun/xml/internal/bind/" excludes=""/>
                                <correct copyright="${lic}" includes="jdk.xml.bind/com/sun/xml/internal/dtdparser/" excludes=""/>
                                <correct copyright="${lic}" includes="java.xml.bind/com/sun/xml/internal/txw2/" excludes=""/>
                                <correct copyright="${lic}" includes="java.xml.ws/com/sun/xml/internal/messaging/" excludes=""/>
                                <correct copyright="${lic}" includes="jdk.xml.bind/com/sun/xml/internal/rngom/" excludes=""/>
                                <correct copyright="${lic}" includes="java.xml.bind/com/sun/xml/internal/org/jvnet/staxex/"
                                         excludes=""/>
                                <correct copyright="${lic}" includes="java.xml.bind/com/sun/xml/internal/org/jvnet/mimepull/"
                                         excludes=""/>
                                <correct copyright="${lic}" includes="java.xml.ws/com/sun/org/glassfish/" excludes=""/>
                                <!-- IMP variation -->
                                <correct copyright="${antdir}/relaxng.txt" includes="jdk.xml.bind/com/sun/xml/internal/org/relaxng/"
                                         excludes="jdk.xml.bind/com/sun/xml/internal/org/relaxng/datatype/helpers/DatatypeLibraryLoader.java"/>

                                <!-- variation --> <!-- com/sun/xml/internal/fastinfoset/AbstractResourceBundle.java has freebxml.org license -->
                                <correct copyright="${antdir}/oracle_gpl_mod.txt"
                                         includes="java.xml.bind/com/sun/xml/internal/fastinfoset/"
                                         excludes="java.xml.bind/com/sun/xml/internal/fastinfoset/org/apache/xerces/util/XMLChar.java"/>

                                <correct copyright="${antdir}/oracle_gpl_mod.txt"
                                         includes="java.xml.bind/com/sun/xml/internal/org/jvnet/fastinfoset/" excludes=""/>
                                <correct copyright="${lic}" includes="java.xml.ws/com/sun/xml/internal/stream/buffer/" excludes=""/>
                                <correct copyright="${lic}" includes="jdk.xml.bind/com/sun/codemodel/internal/" excludes=""/>
                                <correct copyright="${lic}" includes="jdk.xml.bind/com/sun/istack/internal/" excludes=""/>
                                <correct copyright="${lic}" includes="java.xml.bind/com/sun/istack/internal/" excludes=""/>
                                <correct copyright="${lic}" includes="jdk.xml.ws/com/sun/tools/internal/ws/"
                                         excludes="jdk.xml.ws/com/sun/tools/internal/ws/wsdl/parser/NamespaceContextImpl.java"/>
                                <correct copyright="${lic}" includes="jdk.xml.bind/com/sun/tools/internal/xjc/"
                                         excludes="jdk.xml.bind/com/sun/tools/internal/xjc/reader/internalizer/NamespaceContextImpl.java"/>
                                <correct copyright="${lic}" includes="jdk.xml.bind/com/sun/tools/internal/jxc/" excludes=""/>
                                <correct copyright="${lic}" includes="jdk.xml.bind/com/sun/xml/internal/xsom/" excludes=""/>

                                <!-- handle anamalies -->
                                <correct copyright="${antdir}/oracle_gpl_portions_2005-2011.txt"
                                         includes="java.xml.bind/com/sun/xml/internal/fastinfoset/org/apache/xerces/util/XMLChar.java"
                                         excludes=""/>
                                <correct copyright="${antdir}/oracle_gpl_portions_2005-2011.txt"
                                         includes="jdk.xml.ws/com/sun/tools/internal/ws/wsdl/parser/NamespaceContextImpl.java"
                                         excludes=""/>
                                <correct copyright="${antdir}/oracle_gpl_portions_2005-2011.txt"
                                         includes="jdk.xml.bind/com/sun/tools/internal/xjc/reader/internalizer/NamespaceContextImpl.java"
                                         excludes=""/>

                                <correct copyright="${lic}" includes="java.xml.ws/com/oracle/webservices/internal/**/*"
                                         excludes=""/>
                                <correct copyright="${lic}" includes="java.xml.ws/com/oracle/xmlns/internal/**/*" excludes=""/>

                                <!-- add reserve block for the above three files -->
                                <prepend destfile="java.xml.bind/com/sun/xml/internal/fastinfoset/org/apache/xerces/util/XMLChar.java"
                                         srcfile="${antdir}/reserve-block.txt"/>
                                <prepend destfile="jdk.xml.ws/com/sun/tools/internal/ws/wsdl/parser/NamespaceContextImpl.java"
                                         srcfile="${antdir}/reserve-block.txt"/>
                                <prepend
                                        destfile="jdk.xml.bind/com/sun/tools/internal/xjc/reader/internalizer/NamespaceContextImpl.java"
                                        srcfile="${antdir}/reserve-block.txt"/>

                                <!-- See http://openjdk.sfbay.sun.com/space/start/openjdk-legal-notice-howto.html -->
                                <loadfile property="jaxws-asm" srcFile="${antdir}/jaxws-asm.txt"/>
                                <loadfile property="openjdk-asm" srcFile="${antdir}/oracle_openjdk-asm.txt"/>
                                <replace dir="target/generated-sources/java.xml.ws/com/sun/xml/internal/ws/org/objectweb/asm"
                                         token="${jaxws-asm}" value="${openjdk-asm}"/>


                                <echo message="Rebranding done ..."/>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!--repackaging sources to internal packages-->
            <plugin>
                <groupId>com.sun.wts.tools.ant</groupId>
                <artifactId>package-rename-task</artifactId>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <id>repackage-sources</id>
                        <goals>
                            <goal>rename</goal>
                        </goals>
                        <configuration>
                            <srcDir>${project.basedir}/target/unpacked-sources</srcDir>
                            <rootDir>${project.basedir}/target/generated-sources</rootDir>
                            <excludes>com.sun.xml.internal</excludes>
                            <patterns>
                                <!-- java.xml.ws.annotation -->
                                <javax.annotation>java.xml.ws.annotation/javax.annotation</javax.annotation>

                                <!-- ================== MODULE java.xml.ws ================== -->

                                <!--com.sun.xml.ws:rt-->
                                <com.oracle.webservices>java.xml.ws/com.oracle.webservices.internal</com.oracle.webservices>
                                <com.oracle.xmlns>java.xml.ws/com.oracle.xmlns.internal</com.oracle.xmlns>
                                <com.sun.xml.ws>java.xml.ws/com.sun.xml.internal.ws</com.sun.xml.ws>
                                <!--org.glassfish.external:management-api-->
                                <!--org.glassfish.gmbal:gmbal-api-only-->
                                <org.glassfish>java.xml.ws/com.sun.org.glassfish</org.glassfish>
                                <!--com.sun.xml.messaging.saaj-->
                                <com.sun.xml.messaging>java.xml.ws/com.sun.xml.internal.messaging</com.sun.xml.messaging>
                                <!--com.sun.xml.stream.buffer:streambuffer-->
                                <com.sun.xml.stream>java.xml.ws/com.sun.xml.internal.stream</com.sun.xml.stream>
                                <!--javax.jws:jsr181-api-->
                                <javax.jws>java.xml.ws/javax.jws</javax.jws>
                                <!--javax.xml.soap:javax.xml.soap-api-->
                                <javax.xml.soap>java.xml.ws/javax.xml.soap</javax.xml.soap>
                                <!--javax.xml.ws:jaxws-api-->
                                <javax.xml.ws>java.xml.ws/javax.xml.ws</javax.xml.ws>

                                <!-- ================== MODULE java.xml.bind ================== -->
                                <!--istack-commons:istack-commons-runtime-->
                                <com.sun.istack>java.xml.bind/com.sun.istack.internal</com.sun.istack>
                                <com.sun.istack.localization>java.xml.bind/com.sun.istack.internal.localization</com.sun.istack.localization>
                                <com.sun.istack.logging>java.xml.bind/com.sun.istack.internal.logging</com.sun.istack.logging>

                                <!--org.glassfish.jaxb:jaxb-core-->
                                <!--org.glassfish.jaxb:jaxb-runtime-->
                                <com.sun.xml.bind>java.xml.bind/com.sun.xml.internal.bind</com.sun.xml.bind>

                                <!--java.xml.bind:jaxb-api-->
                                <javax.xml.bind>java.xml.bind/javax.xml.bind</javax.xml.bind>
                                <!--com.sun.xml.fastinfoset:FastInfoset-->
                                <com.sun.xml.fastinfoset>java.xml.bind/com.sun.xml.internal.fastinfoset</com.sun.xml.fastinfoset>
                                <org.jvnet.fastinfoset>java.xml.bind/com.sun.xml.internal.org.jvnet.fastinfoset</org.jvnet.fastinfoset>

                                <!--org.jvnet.staxex:stax-ex-->
                                <org.jvnet.staxex>java.xml.bind/com.sun.xml.internal.org.jvnet.staxex</org.jvnet.staxex>
                                <!--org.jvnet.mimepull:mimepull-->
                                <org.jvnet.mimepull>java.xml.bind/com.sun.xml.internal.org.jvnet.mimepull</org.jvnet.mimepull>
                                <!--org.glassfish.jaxb:txw2-->
                                <com.sun.xml.txw2>java.xml.bind/com.sun.xml.internal.txw2</com.sun.xml.txw2>

                                <!-- ================== MODULE jdk.xml.ws ================== -->
                                <com.sun.tools.ws>jdk.xml.ws/com.sun.tools.internal.ws</com.sun.tools.ws>

                                <!-- ================== MODULE jdk.xml.bind ================== -->
                                <org.relaxng.datatype>jdk.xml.bind/com.sun.xml.internal.org.relaxng.datatype</org.relaxng.datatype>
                                <com.sun.codemodel>jdk.xml.bind/com.sun.codemodel.internal</com.sun.codemodel>
                                <com.sun.istack.tools>jdk.xml.bind/com.sun.istack.internal.tools</com.sun.istack.tools>
                                <com.sun.tools.jxc>jdk.xml.bind/com.sun.tools.internal.jxc</com.sun.tools.jxc>
                                <com.sun.tools.xjc>jdk.xml.bind/com.sun.tools.internal.xjc</com.sun.tools.xjc>
                                <com.sun.xml.dtdparser>jdk.xml.bind/com.sun.xml.internal.dtdparser</com.sun.xml.dtdparser>
                                <org.kohsuke.rngom>jdk.xml.bind/com.sun.xml.internal.rngom</org.kohsuke.rngom>
                                <com.sun.xml.xsom>jdk.xml.bind/com.sun.xml.internal.xsom</com.sun.xml.xsom>

                            </patterns>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Replaces MetroConfigLoader jaxws-tubes-default.xml file location-->
            <plugin>
                <groupId>com.google.code.maven-replacer-plugin</groupId>
                <artifactId>replacer</artifactId>
                <executions>
                    <execution>
                        <id>update-jaxws-tubes-default-xml-location-in-metro-config-loader-java</id>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>replace</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <file>${project.build.directory}/generated-sources/java.xml.ws/com/sun/xml/internal/ws/assembler/MetroConfigLoader.java</file>
                    <replacements>
                        <replacement>
                            <token>META-INF/</token>
                            <value>com/sun/xml/internal/ws/assembler/</value>
                        </replacement>
                    </replacements>
                </configuration>
            </plugin>

            <!--spaces normalization-->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>normalize-spaces</id>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>src/main/ant/normalizer</executable>
                            <arguments>
                                <argument>-e</argument>
                                <argument>java,properties,xml</argument>
                                <argument>target/generated-sources/</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!--compilation to verify the sources are complete-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-compile</id>
                        <configuration>
                            <fork>true</fork>
                            <!--redirecting to different place not to be contained in the result bundle-->
                            <generatedSourcesDirectory>${project.build.directory}/annotations</generatedSourcesDirectory>
                            <forceJavacCompilerUse>true</forceJavacCompilerUse>
                            <compilerArgs combine.self="override">
                                <arg>--add-modules</arg>
                                <arg>java.activation,java.xml</arg>
                                <!--<arg>-Xmodule:java.xml.ws</arg>-->
                                <!--<arg>-XDignore.symbol.file</arg>-->
                            </compilerArgs>
                        </configuration>
                    </execution>
                    <execution>
                        <id>base-compile</id>
                        <configuration>
                            <skipMain>true</skipMain>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
