Add a "update-site" module to build a p2 update site

Turns out it is much easier to use within Eclipse if we just package
the plugins in a p2 update site. We can then just add the results
to a target configuration file.

Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
diff --git a/ctf/pom.xml b/ctf/pom.xml
index d4ba1b1..7731aa2 100644
--- a/ctf/pom.xml
+++ b/ctf/pom.xml
@@ -20,6 +20,14 @@
 
   <artifactId>tracecompass-test-traces-ctf</artifactId>
 
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>RELEASE</version>
+    </dependency>
+  </dependencies>
+
   <build>
     <plugins>
       <plugin>
diff --git a/pom.xml b/pom.xml
index 0a58efc..db97e6a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,21 +22,13 @@
   <packaging>pom</packaging>
 
   <properties>
-    <tycho-version>0.23.1</tycho-version>
     <manifest-location>META-INF</manifest-location>
-    <deploy-destination>file:///home/data/httpd/archive.eclipse.org/tracecompass/tracecompass-test-traces/</deploy-destination>
+    <maven-deploy-destination>file:///home/data/httpd/archive.eclipse.org/tracecompass/tracecompass-test-traces/maven/</maven-deploy-destination>
   </properties>
 
-  <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>RELEASE</version>
-    </dependency>
-  </dependencies>
-
   <modules>
     <module>ctf</module>
+    <module>update-site</module>
   </modules>
 
   <build>
@@ -77,7 +69,7 @@
   <distributionManagement>
     <repository>
       <id>test-traces-repo</id>
-      <url>${deploy-destination}</url>
+      <url>${maven-deploy-destination}</url>
     </repository>
   </distributionManagement>
 
diff --git a/update-site/pom.xml b/update-site/pom.xml
new file mode 100644
index 0000000..b5bf42e
--- /dev/null
+++ b/update-site/pom.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   Copyright (C) 2015 EfficiOS Inc., Alexandre Montplaisir
+
+   All rights reserved. This program and the accompanying materials
+   are made available under the terms of the Eclipse Public License v1.0
+   which accompanies this distribution, and is available at
+   http://www.eclipse.org/legal/epl-v10.html
+-->
+
+<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.eclipse.tracecompass.testtraces</groupId>
+    <artifactId>tracecompass-test-traces-parent</artifactId>
+    <version>1.0.0</version>
+  </parent>
+
+  <artifactId>tracecompass-test-traces-update-site</artifactId>
+  <packaging>pom</packaging>
+
+  <properties>
+    <p2-deploy-destination>/home/data/httpd/archive.eclipse.org/tracecompass/tracecompass-test-traces/repository/</p2-deploy-destination>
+  </properties>
+
+  <pluginRepositories>
+    <pluginRepository>
+      <id>reficio</id>
+      <url>http://repo.reficio.org/maven/</url>
+    </pluginRepository>
+  </pluginRepositories>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.reficio</groupId>
+        <artifactId>p2-maven-plugin</artifactId>
+        <version>1.2.0-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <id>generate-p2-repo</id>
+            <phase>compile</phase>
+            <goals>
+              <goal>site</goal>
+            </goals>
+            <configuration>
+              <artifacts>
+                <artifact><id>org.eclipse.tracecompass.testtraces:tracecompass-test-traces-ctf:1.0.0</id></artifact>
+              </artifacts>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <version>1.8</version>
+        <executions>
+          <execution>
+            <id>deploy-p2-repo</id>
+            <phase>deploy</phase>
+              <goals>
+                <goal>run</goal>
+              </goals>
+              <configuration>
+              <target>
+                <!--
+                <delete includeemptydirs="false">
+                  <fileset
+                    dir="${deploy-destination}">
+                    <include name="**" />
+                  </fileset>
+                </delete>
+                -->
+                <copy includeemptydirs="false"
+                  todir="${p2-deploy-destination}">
+                  <fileset dir="target/repository">
+                    <include name="**" />
+                  </fileset>
+                </copy>
+              </target>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>