<?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">

  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.drools</groupId>
    <artifactId>droolsjbpm-build-distribution</artifactId>
    <version>6.2.0.Final</version>
  </parent>

  <artifactId>droolsjbpm-uber-distribution</artifactId>
  <packaging>pom</packaging>

  <name>Drools and jBPM uber distribution</name>
  <description>
    Aggregates all distributions into one directory to make it easier to upload it to the website.
  </description>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <descriptors>
            <descriptor>src/main/assembly/assembly-droolsjbpm-uber.xml</descriptor>
          </descriptors>
          <appendAssemblyId>false</appendAssemblyId> 
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <inherited>false</inherited>
        <executions>
          <execution>
            <id>install</id>
            <phase>install</phase>
            <configuration>
              <quiet>true</quiet>
              <tasks>
                <script language="javascript">
                  <![CDATA[
                    property = project.setProperty("p2.timestamp.now",Math.floor((new Date()).getTime()/1000));
                  ]]>
                </script>
                <echo>Changing p2.timestamp in latest/composite*.xml files to ${p2.timestamp.now}</echo>
                <replaceregexp match="@@p2.timestamp.now@@" replace="${p2.timestamp.now}000">
                  <fileset dir="${basedir}/target">
                    <include name="**/droolsjbpm-uber-distribution*/download_jboss_org/latest/composite*.xml"/>
                  </fileset>
                </replaceregexp>
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant</artifactId>
            <version>1.8.2</version>
          </dependency>
        </dependencies>
      </plugin>      
    </plugins>
  </build>

  <dependencies>
    <!-- Binaries and sources -->
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-distribution</artifactId>
      <type>zip</type>
    </dependency>
    <dependency>
      <groupId>org.optaplanner</groupId>
      <artifactId>optaplanner-distribution</artifactId>
      <type>zip</type>
    </dependency>
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>droolsjbpm-integration-distribution</artifactId>
      <type>zip</type>
    </dependency>
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>droolsjbpm-tools-distribution</artifactId>
      <type>zip</type>
    </dependency>

    <!-- Javadocs and documentation -->
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-docs</artifactId>
      <type>jdocbook</type>
    </dependency>
    <dependency>
      <groupId>org.optaplanner</groupId>
      <artifactId>optaplanner-docs</artifactId>
      <type>jdocbook</type>
    </dependency>
<!--    <dependency>
      <groupId>org.jbpm</groupId>
      <artifactId>jbpm-docs</artifactId>
      <type>jdocbook</type>
    </dependency>-->

    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-api</artifactId>
      <classifier>javadoc</classifier>
    </dependency>
    <dependency>
      <groupId>org.optaplanner</groupId>
      <artifactId>optaplanner-core</artifactId>
      <classifier>javadoc</classifier>
    </dependency>
  </dependencies>

</project>
