<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.thoughtworks.paranamer</groupId>
    <artifactId>paranamer-parent</artifactId>
    <version>2.8</version>
  </parent>
  <artifactId>paranamer-distribution</artifactId>
  <packaging>pom</packaging>
  <name>ParaNamer Distribution</name>

  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>paranamer-generator</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>paranamer-ant</artifactId>
      <version>${project.version}</version>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.10</version>
        <executions>
          <execution>
            <id>unpack</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/site/javadoc</outputDirectory>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
              <artifactItems>
                <artifactItem>
                  <groupId>${project.groupId}</groupId>
                  <artifactId>paranamer</artifactId>
                  <version>${project.version}</version>
                  <classifier>javadoc</classifier>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>generate-resources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
                <delete includeEmptyDirs="true">
                  <fileset dir="${project.build.directory}/site" includes="**/META-INF/*" />
                  <fileset dir="${project.build.directory}/site" 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/site/**" />
                    <exclude name="target/site" />
                  </fileset>
                  <filtermapper>
                    <replacestring from="target${file.separator}site${file.separator}" to="${file.separator}" />
                  </filtermapper>
                </copy>
              </tasks>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.5.4</version>
        <executions>
          <execution>
            <id>bin</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptor>${basedir}/src/assembly/assembly-bin.xml</descriptor>
              <finalName>paranamer-${project.version}</finalName>
              <workDirectory>${project.build.directory}/assembly/bin</workDirectory>
            </configuration>
          </execution>
          <execution>
            <id>src</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptor>${basedir}/src/assembly/assembly-src.xml</descriptor>
              <finalName>paranamer-${project.version}</finalName>
              <workDirectory>${project.build.directory}/assembly/src</workDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
