<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>
    <groupId>com.iona.fuse</groupId>
    <artifactId>all-products</artifactId>
    <packaging>pom</packaging>
    <version>1.0.0.0-fuse</version>
    <name>Product Repository</name>

    <properties>
        <activemq.groupid>org.apache.activemq</activemq.groupid>
        <activemq.artifactid>apache-activemq</activemq.artifactid>
        <activemq.version>5.11.0.redhat-620133</activemq.version>
        <camel.groupid>org.apache.camel</camel.groupid>
        <camel.artifactid>apache-camel</camel.artifactid>
        <camel.version>2.15.1.redhat-620133</camel.version>
        <cxf.groupid>org.apache.cxf</cxf.groupid>
        <cxf.artifactid>apache-cxf</cxf.artifactid>
        <cxf.version>3.0.4.redhat-620133</cxf.version>
    </properties>

    <!-- For each product, get the source, along with the product installer of both Unix and Windows as well as the offline Repo -->
    <dependencies>
      <!-- ActiveMQ -->
        <dependency>
            <groupId>${activemq.groupid}</groupId>
            <artifactId>${activemq.artifactid}</artifactId>
            <version>${activemq.version}</version>
            <classifier>bin</classifier>
            <type>tar.gz</type>
        </dependency>
        <dependency>
            <groupId>${activemq.groupid}</groupId>
            <artifactId>${activemq.artifactid}</artifactId>
            <version>${activemq.version}</version>
            <classifier>bin</classifier>
            <type>tar.gz.md5</type>
        </dependency>
        <dependency>
            <groupId>${activemq.groupid}</groupId>
            <artifactId>${activemq.artifactid}</artifactId>
            <version>${activemq.version}</version>
            <classifier>bin</classifier>
            <type>tar.gz.sha1</type>
        </dependency>
        <dependency>
            <groupId>${activemq.groupid}</groupId>
            <artifactId>${activemq.artifactid}</artifactId>
            <version>${activemq.version}</version>
            <classifier>bin</classifier>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>${activemq.groupid}</groupId>
            <artifactId>${activemq.artifactid}</artifactId>
            <version>${activemq.version}</version>
            <classifier>bin</classifier>
            <type>zip.md5</type>
        </dependency>
        <dependency>
            <groupId>${activemq.groupid}</groupId>
            <artifactId>${activemq.artifactid}</artifactId>
            <version>${activemq.version}</version>
            <classifier>bin</classifier>
            <type>zip.sha1</type>
        </dependency>

        <!-- Camel -->
        <dependency>
            <groupId>${camel.groupid}</groupId>
            <artifactId>${camel.artifactid}</artifactId>
            <version>${camel.version}</version>
            <classifier>src</classifier>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>${camel.groupid}</groupId>
            <artifactId>${camel.artifactid}</artifactId>
            <version>${camel.version}</version>
            <classifier>src</classifier>
            <type>zip.md5</type>
        </dependency>
        <dependency>
            <groupId>${camel.groupid}</groupId>
            <artifactId>${camel.artifactid}</artifactId>
            <version>${camel.version}</version>
            <classifier>src</classifier>
            <type>zip.sha1</type>
        </dependency>

        <!-- CXF -->
        <dependency>
            <groupId>${cxf.groupid}</groupId>
            <artifactId>${cxf.artifactid}</artifactId>
            <version>${cxf.version}</version>
            <classifier>src</classifier>
            <type>tar.gz</type>
        </dependency>
        <dependency>
            <groupId>${cxf.groupid}</groupId>
            <artifactId>${cxf.artifactid}</artifactId>
            <version>${cxf.version}</version>
            <classifier>src</classifier>
            <type>tar.gz.md5</type>
        </dependency>
        <dependency>
            <groupId>${cxf.groupid}</groupId>
            <artifactId>${cxf.artifactid}</artifactId>
            <version>${cxf.version}</version>
            <classifier>src</classifier>
            <type>tar.gz.sha1</type>
        </dependency>
        <dependency>
            <groupId>${cxf.groupid}</groupId>
            <artifactId>${cxf.artifactid}</artifactId>
            <version>${cxf.version}</version>
            <classifier>src</classifier>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>${cxf.groupid}</groupId>
            <artifactId>${cxf.artifactid}</artifactId>
            <version>${cxf.version}</version>
            <classifier>src</classifier>
            <type>zip.md5</type>
        </dependency>
        <dependency>
            <groupId>${cxf.groupid}</groupId>
            <artifactId>${cxf.artifactid}</artifactId>
            <version>${cxf.version}</version>
            <classifier>src</classifier>
            <type>zip.sha1</type>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId> 
                 <executions>
                  <execution>
                        <id>copy-dependencies-activemq</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/${activemq.artifactid}</outputDirectory>
                            <excludeTransitive>true</excludeTransitive>
                            <includeArtifactIds>apache-activemq</includeArtifactIds>
                        </configuration> 
                    </execution>
                    <execution>
                        <id>copy-dependencies-camel</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/${camel.artifactid}</outputDirectory>
                            <excludeTransitive>true</excludeTransitive>
                            <includeArtifactIds>apache-camel</includeArtifactIds>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-dependencies-cxf</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/${cxf.artifactid}</outputDirectory>
                            <excludeTransitive>true</excludeTransitive>
                            <includeArtifactIds>apache-cxf</includeArtifactIds>
                        </configuration>
                    </execution>
         	    <execution>
                        <id>copy-dependencies-repository</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}</outputDirectory>
                            <excludeTransitive>true</excludeTransitive>
                            <includeArtifactIds>repo</includeArtifactIds>
                        </configuration>
                    </execution>
		   </executions> 
            </plugin> 
            <!-- Delete all the Fuse Products and offline repo file in the local repository -->
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-antrun-plugin</artifactId>
              <executions>
                <execution>
                  <phase>package</phase>
                  <configuration>
                    <tasks>
                      <delete>
                        <fileset dir="${settings.localRepository}">
                          <include name="**/apache-activemq-${activemq.version}*.*"/>
                          <include name="**/apache-camel-${camel.version}*.*"/>
                          <include name="**/apache-cxf-${cxf.version}*.*"/> 
                        </fileset>
                      </delete>
                    </tasks>
                  </configuration>
                  <goals>
                    <goal>run</goal>
                  </goals>
                </execution>
              </executions>
	   </plugin>                      
        </plugins>
    </build>
</project>
