diff --git a/adam-cli/pom.xml b/adam-cli/pom.xml
index d0b24d09b2..22eb631680 100644
--- a/adam-cli/pom.xml
+++ b/adam-cli/pom.xml
@@ -33,23 +33,6 @@
-
- org.apache.maven.plugins
- maven-assembly-plugin
-
-
- src/main/assembly/assembly.xml
-
-
-
-
- package
-
- single
-
-
-
-
org.apache.maven.plugins
diff --git a/bin/adam-submit b/bin/adam-submit
index edcd4634ba..90d56a34de 100755
--- a/bin/adam-submit
+++ b/bin/adam-submit
@@ -18,26 +18,34 @@
#
# Figure out where ADAM is installed
-ADAM_REPO="$(cd `dirname $0`/..; pwd)"
+SCRIPT_DIR="$(cd `dirname $0`/..; pwd)"
# Get list of required jars for ADAM
-ADAM_JARS=$("$ADAM_REPO"/bin/compute-adam-jars.sh)
+ADAM_JARS=$("$SCRIPT_DIR"/bin/compute-adam-jars.sh)
+
+# Binary distribution
+REPO_DIR="$SCRIPT_DIR/repo"
+if [ ! -d "$REPO_DIR" ]; then
+# Fallback to source directory
+REPO_DIR="$SCRIPT_DIR/adam-cli/target/appassembler/repo/"
+fi
# Find the ADAM CLI jar
-num_versions=$(ls "$ADAM_REPO"/adam-cli/target/appassembler/repo/org/bdgenomics/adam/adam-cli | wc -l)
+CLI_DIR="$REPO_DIR/org/bdgenomics/adam/adam-cli"
+num_versions=$(ls "$CLI_DIR" | wc -l)
if [ "$num_versions" -eq "0" ]; then
- echo "Failed to find adam-cli jar in $ADAM_REPO/adam-cli/target/appassembler/repo/org/bdgenomics/adam/adam-cli"
+ echo "Failed to find adam-cli jar in $CLI_DIR"
echo "You need to build ADAM before running this program."
exit 1
fi
if [ "$num_versions" -gt "1" ]; then
- versions_list=$(ls "$ADAM_REPO"/adam-cli/target/appassembler/repo/org/bdgenomics/adam/adam-cli)
- echo "Found multiple ADAM CLI versions in $ADAM_REPO/adam-cli/target/appassembler/repo/org/bdgenomics/adam/adam-cli:"
+ versions_list=$(ls "$CLI_DIR")
+ echo "Found multiple ADAM CLI versions in $CLI_DIR:"
echo "$versions_list"
echo "Please remove all but one."
exit 1
fi
-ADAM_CLI_JAR="$(ls "$ADAM_REPO"/adam-cli/target/appassembler/repo/org/bdgenomics/adam/adam-cli/*/adam-cli-*.jar)"
+ADAM_CLI_JAR=$(ls $CLI_DIR/*/adam-cli-*.jar)
# Find spark-submit script
if [ -z "$SPARK_HOME" ]; then
diff --git a/bin/compute-adam-classpath.sh b/bin/compute-adam-classpath.sh
index c45983a635..e1fbed009f 100755
--- a/bin/compute-adam-classpath.sh
+++ b/bin/compute-adam-classpath.sh
@@ -18,16 +18,25 @@
#
# Figure out where ADAM is installed
-ADAM_REPO="$(cd `dirname $0`/..; pwd)"
+SCRIPT_DIR="$(cd `dirname $0`/..; pwd)"
-# Next three commands set CLASSPATH like appassembler
-BASEDIR="$ADAM_REPO"/adam-cli/target/appassembler
-REPO="$BASEDIR"/repo
-if [ ! -f "$BASEDIR"/bin/adam ]; then
+# Setup CLASSPATH like appassembler
+
+# Assume we're running in a binary distro
+ADAM_CMD="$SCRIPT_DIR/bin/adam"
+REPO="$SCRIPT_DIR/repo"
+
+# Fallback to source repo
+if [ ! -f $ADAM_CMD ]; then
+ADAM_CMD="$SCRIPT_DIR/adam-cli/target/appassembler/bin/adam"
+REPO="$SCRIPT_DIR/adam-cli/target/appassembler/repo"
+fi
+
+if [ ! -f "$ADAM_CMD" ]; then
echo "Failed to find appassembler scripts in $BASEDIR/bin"
echo "You need to build ADAM before running this program"
exit 1
fi
-eval $(cat "$BASEDIR"/bin/adam | grep "^CLASSPATH")
+eval $(cat "$ADAM_CMD" | grep "^CLASSPATH")
echo "$CLASSPATH"
diff --git a/distribution/pom.xml b/distribution/pom.xml
new file mode 100644
index 0000000000..55b4ebb3d8
--- /dev/null
+++ b/distribution/pom.xml
@@ -0,0 +1,53 @@
+
+
+ 4.0.0
+
+ org.bdgenomics.adam
+ adam-parent
+ 0.14.1-SNAPSHOT
+ ../pom.xml
+
+
+ adam-distribution
+ pom
+ ADAM: Distribution
+
+
+
+ exec-maven-plugin
+ org.codehaus.mojo
+
+
+ Generate Documentation
+ generate-sources
+
+ exec
+
+
+ ${project.basedir}/../docs
+ ./build.sh
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-assembly-plugin
+
+
+ src/main/assembly/assembly.xml
+
+
+
+
+ package
+
+ single
+
+
+
+
+
+
+
diff --git a/distribution/src/main/assembly/assembly.xml b/distribution/src/main/assembly/assembly.xml
new file mode 100644
index 0000000000..40033bc5c8
--- /dev/null
+++ b/distribution/src/main/assembly/assembly.xml
@@ -0,0 +1,67 @@
+
+
+ bin
+
+ tar.gz
+ tar.bz2
+ zip
+
+
+
+ ../
+
+ LICENSE.txt
+ NOTICE.txt
+ CHANGES.md
+ CONTRIBUTING.md
+ README.md
+
+ .
+
+
+ ../adam-cli/target/appassembler/bin
+ bin
+
+ *.bat
+
+ 0755
+ 0755
+
+
+ ../adam-cli/target/appassembler/bin
+ bin
+
+ *.bat
+
+ 0755
+ 0644
+
+
+ ../adam-cli/target/appassembler/repo
+ repo
+ 0755
+ 0644
+
+
+ ../bin
+ bin
+ 0755
+ 0755
+
+
+ ../docs/output
+ docs
+ 0755
+ 0755
+
+
+
+
diff --git a/docs/build.sh b/docs/build.sh
index 5ba7938a70..f31d8d5185 100755
--- a/docs/build.sh
+++ b/docs/build.sh
@@ -3,6 +3,7 @@
git_version=$(git rev-parse --short HEAD)
output_dir="output"
+rm $output_dir/* 2>/dev/null
pdf_output="$output_dir/ADAM_v$git_version.pdf"
html_output="$output_dir/ADAM_v$git_version.html"
date_str=$(date '+%Y-%m-%d')
diff --git a/pom.xml b/pom.xml
index 5d572d10ad..a170dfedb2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,6 +32,8 @@
adam-core
adam-apis
adam-cli
+
+ distribution