Add source-release assembly

Change-Id: I58accc2cfa283ae646bfcb70679f66048846cea6
Reviewed-on: https://asterix-gerrit.ics.uci.edu/373
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Ian Maxon <imaxon@apache.org>
diff --git a/LICENSE.txt b/LICENSE
similarity index 100%
rename from LICENSE.txt
rename to LICENSE
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 0000000..317d8fa
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,5 @@
+Apache AsterixDB Hyracks and Algebricks
+Copyright 2009-2015 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
diff --git a/pom.xml b/pom.xml
index 5711f2f..504201b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -194,6 +194,31 @@
           </excludes>
 	</configuration>
       </plugin>
+      <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-assembly-plugin</artifactId>
+<!-- We override the configuration plugin to override the descriptor to use for building
+  the source release zip. Specifically, we would like to control the inclusions/exclusions.
+  For example, we exclude the KEYS file from the zip -->
+          <executions>
+              <execution>
+    <!-- Use this id to match the id mentioned in the assembly plugin configuration in
+      the apache parent POM under the apache-release profile -->
+                  <id>source-release-assembly</id>
+                  <phase>package</phase>
+                  <goals>
+                      <goal>single</goal>
+                  </goals>
+    <!-- combine.self should be override to replace the configuration in the parent POM -->
+                  <configuration combine.self="override">
+                      <runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
+                      <descriptors>
+                          <descriptor>src/main/assembly/source.xml</descriptor>
+                      </descriptors>
+                  </configuration>
+              </execution>
+          </executions>
+      </plugin>
     </plugins>
   </build>
 
diff --git a/src/main/assembly/source.xml b/src/main/assembly/source.xml
new file mode 100644
index 0000000..210c49a
--- /dev/null
+++ b/src/main/assembly/source.xml
@@ -0,0 +1,43 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+      http://www.apache.org/licenses/LICENSE-2.0
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+  <id>source-release</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <fileSets>
+    <fileSet>
+      <directory>${project.basedir}</directory>
+      <outputDirectory>/</outputDirectory>
+      <useDefaultExcludes>true</useDefaultExcludes>
+      <includes>
+        <include>**/DISCLAIMER</include>
+        <include>**/LICENSE</include>
+        <include>**/NOTICE</include>
+        <include>**/README</include>
+        <include>**/src/**</include>
+        <include>**/results/**</include>
+        <include>**/pom.xml</include>
+        <include>**/build*.xml</include>
+        <include>**/findbugs*.xml</include>
+      </includes>
+      <excludes>
+        <exclude>**/${project.build.directory}/**</exclude>
+      </excludes>
+    </fileSet>
+  </fileSets>
+</assembly>