<?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/maven-v4_0_0.xsd">
  <parent>
    <artifactId>bundles</artifactId>
    <groupId>org.glassfish.metro</groupId>
    <version>2.4.8</version>
    <relativePath>../../pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>webservices-tools</artifactId>
  <name>Metro Web Services Tools non-OSGi Bundle</name>
  <description>This module contains the Metro tooling code.</description>
  <build>
    <resources>
      <resource>
        <filtering>true</filtering>
        <directory>src/main/resources</directory>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>com.sun.istack</groupId>
        <artifactId>istack-commons-maven-plugin</artifactId>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>rs-gen</goal>
            </goals>
            <configuration>
              <resources>
                <directory>${basedir}/non-existing</directory>
                <includes>
                  <include>**/*.xyz</include>
                </includes>
              </resources>
              <destDir>${project.build.directory}/rsrc-gen</destDir>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>unpack-sources</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <excludes>module-info*</excludes>
              <artifactItems>
                <artifactItem>
                  <groupId>com.sun.xml.bind</groupId>
                  <artifactId>jaxb-xjc</artifactId>
                  <classifier>sources</classifier>
                  <overWrite>false</overWrite>
                  <outputDirectory>${generated.sources.dir}</outputDirectory>
                </artifactItem>
                <artifactItem>
                  <groupId>com.sun.xml.bind</groupId>
                  <artifactId>jaxb-jxc</artifactId>
                  <classifier>sources</classifier>
                  <overWrite>false</overWrite>
                  <outputDirectory>${generated.sources.dir}</outputDirectory>
                </artifactItem>
                <artifactItem>
                  <groupId>com.sun.xml.ws</groupId>
                  <artifactId>jaxws-tools</artifactId>
                  <classifier>sources</classifier>
                  <overWrite>false</overWrite>
                  <outputDirectory>${generated.sources.dir}</outputDirectory>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <phase>prepare-package</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${generated.sources.dir}</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <id>create-shaded-jar</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <artifactSet>
                <includes>
                  <include>com.sun.xml.ws:jaxws-tools</include>
                  <include>com.sun.xml.bind:jaxb-xjc</include>
                  <include>com.sun.xml.bind:jaxb-jxc</include>
                </includes>
              </artifactSet>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>module-info.java</exclude>
                    <exclude>META-INF/jing-copying.html</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>com.sun.xml.ws:jaxws-tools</artifact>
                  <excludes>
                    <exclude>com/sun/tools/ws/version.properties</exclude>
                  </excludes>
                </filter>
              </filters>
              <dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
              <transformers>
                <transformer />
                <transformer>
                  <manifestEntries>
                    <Main-Class>com.sun.tools.ws.WsImport</Main-Class>
                    <Class-Path>webservices-rt.jar</Class-Path>
                    <Multi-Release>true</Multi-Release>
                  </manifestEntries>
                </transformer>
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <quiet>true</quiet>
          <minmemory>128m</minmemory>
          <maxmemory>512m</maxmemory>
          <additionalDependencies>
            <dependency>
              <groupId>com.sun.org.apache.xml.internal</groupId>
              <artifactId>resolver</artifactId>
              <version>${resolver.version}</version>
            </dependency>
          </additionalDependencies>
          <sourceFileExcludes>
            <sourceFileExclude>META-INF/**</sourceFileExclude>
          </sourceFileExcludes>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.glassfish.jaxb</groupId>
      <artifactId>jaxb-xjc</artifactId>
      <version>2.3.5</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jaxb</groupId>
      <artifactId>jaxb-jxc</artifactId>
      <version>2.3.5</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.glassfish.metro</groupId>
      <artifactId>webservices-api</artifactId>
      <version>2.4.8</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.glassfish.metro</groupId>
      <artifactId>webservices-rt</artifactId>
      <version>2.4.8</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.ant</groupId>
      <artifactId>ant</artifactId>
      <version>1.10.11</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  <properties>
    <build.version>Eclipse Metro/${project.version} (${build.id}) JAXWS-RI/${jaxws.ri.version} JAXWS-API/${jaxws-api.version} JAXB-RI/${jaxb.version} JAXB-API/${jaxb-api.version}</build.version>
    <build.id>${scmBranch}-${buildNumber}; ${timestamp}</build.id>
    <generated.sources.dir>${project.build.directory}/generated-sources</generated.sources.dir>
  </properties>
</project>
