<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">
    <!--
     Copyright (C) 2006 Joe Walnes.
     Copyright (C) 2006, 2007, 2008, 2009, 2011, 2012, 2013, 2015, 2016 XStream committers.
     All rights reserved.
     
     The software in this package is published under the terms of the BSD
     style license a copy of which has been included with this distribution in
     the LICENSE.txt file.
     
     Created on 29. July 2006 by Mauro Talevi
     -->
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.thoughtworks.xstream</groupId>
    <artifactId>xstream-parent</artifactId>
    <version>1.4.18</version>
  </parent>
  <artifactId>xstream-distribution</artifactId>
  <packaging>pom</packaging>
  <name>XStream Distribution</name>
  <description>
    Distribution project for XStream to build distributables and documentation.
  </description>

  <dependencies>
    <dependency>
      <groupId>com.thoughtworks.xstream</groupId>
      <artifactId>xstream</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>com.thoughtworks.xstream</groupId>
      <artifactId>xstream-hibernate</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>com.thoughtworks.xstream</groupId>
      <artifactId>xstream-jmh</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>com.thoughtworks.xstream</groupId>
      <artifactId>xstream-benchmark</artifactId>
      <scope>runtime</scope>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>jdk18</id>
      <activation>
        <jdk>1.8</jdk>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.xsite</groupId>
            <artifactId>xsite-maven-plugin</artifactId>
            <configuration>
              <sourceDirectoryPath>${basedir}/src</sourceDirectoryPath>
              <sitemapPath>content/website.xml</sitemapPath>
              <skinPath>templates/skin.html</skinPath>
              <compositionFilePath>xsite/xsite.xml</compositionFilePath>
              <resourcePaths>resources</resourcePaths>
              <outputDirectoryPath>${project.build.directory}/xsite</outputDirectoryPath>
            </configuration>
            <executions>
              <execution>
                <phase>package</phase>
                <goals>
                   <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>process-xsite</id>
                <phase>package</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <tasks>
                    <delete includeEmptyDirs="true">
                      <fileset dir="${project.build.directory}/xsite" includes="**/META-INF/*" />
                      <fileset dir="${project.build.directory}/xsite" includes="**/META-INF" />
                    </delete>
                    <mkdir dir="${project.build.directory}/docs" />
                    <copy todir="${project.build.directory}/docs" overwrite="true" failonerror="false">
                      <fileset dir="${basedir}">
                        <include name="target/xsite/**" />
                        <exclude name="target/xsite" />
                      </fileset>
                      <filtermapper>
                        <replacestring from="target${file.separator}xsite${file.separator}" to="${file.separator}" />
                      </filtermapper>
                    </copy>
                  </tasks>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <dependencies>
        <dependency>
          <groupId>com.thoughtworks.xstream</groupId>
          <artifactId>xstream</artifactId>
          <classifier>javadoc</classifier>
        </dependency>
        <dependency>
          <groupId>com.thoughtworks.xstream</groupId>
          <artifactId>xstream-hibernate</artifactId>
          <classifier>javadoc</classifier>
        </dependency>
        <dependency>
          <groupId>com.thoughtworks.xstream</groupId>
          <artifactId>xstream-jmh</artifactId>
          <classifier>javadoc</classifier>
        </dependency>
      </dependencies>
    </profile>
  </profiles>

  <build>
    <plugins>
      <plugin>
    	<groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>collect-xstream-artifacts</id>
            <phase>package</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <outputDirectory>target/libs</outputDirectory>
              <includeScope>runtime</includeScope>
              <excludeTransitive>true</excludeTransitive>
            </configuration>
          </execution>
          <execution>
            <id>unpack-core</id>
            <phase>package</phase>
            <goals>
              <goal>unpack-dependencies</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/xsite/javadoc</outputDirectory>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
              <includeArtifactIds>xstream</includeArtifactIds>
              <includeClassifiers>javadoc</includeClassifiers>
              <includeScope>provided</includeScope>
            </configuration>
          </execution>
          <execution>
            <id>unpack-hibernate</id>
            <phase>package</phase>
            <goals>
              <goal>unpack-dependencies</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/xsite/hibernate-javadoc</outputDirectory>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
              <includeArtifactIds>xstream-hibernate</includeArtifactIds>
              <includeClassifiers>javadoc</includeClassifiers>
              <includeScope>provided</includeScope>
            </configuration>
          </execution>
          <execution>
            <id>unpack-jmh</id>
            <phase>package</phase>
            <goals>
              <goal>unpack-dependencies</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/xsite/jmh-javadoc</outputDirectory>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
              <includeArtifactIds>xstream-jmh</includeArtifactIds>
              <includeClassifiers>javadoc</includeClassifiers>
              <includeScope>provided</includeScope>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>bin</id>
            <phase>package</phase>
            <goals>
              <goal>attached</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>${basedir}/src/assembly/assembly-bin.xml</descriptor>
              </descriptors>
              <finalName>xstream-${project.version}</finalName>
              <workDirectory>${project.build.directory}/assembly/bin</workDirectory>
            </configuration>
          </execution>
          <execution>
            <id>src</id>
            <phase>package</phase>
            <goals>
              <goal>attached</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>${basedir}/src/assembly/assembly-src.xml</descriptor>
              </descriptors>
              <finalName>xstream-${project.version}</finalName>
              <workDirectory>${project.build.directory}/assembly/src</workDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
