diff --git a/build_java.sh b/build_java.sh
index aded38915..b0e1442fc 100755
--- a/build_java.sh
+++ b/build_java.sh
@@ -1,14 +1,86 @@
#!/bin/bash -e
-cd $LEVELDB_HOME
-git apply $LEVELDB_HOME/java/leveldbjni/db.h.patch
-make clean libleveldb.a
-cd $LEVELDB_HOME
-cd java/leveldb/leveldb-api
-mvn clean package
-export JAVA_HOME=/usr/local/jdk-6u14-64/
-export LEVELDBJNI_HOME=$LEVELDB_HOME/java/leveldbjni/
-export SNAPPY_HOME=/home/dhruba/snappy-1.0.5
-cd $LEVELDBJNI_HOME
-mvn clean install -P linux64
-cd $LEVELDB_HOME
-git checkout $LEVELDB_HOME/include/leveldb/db.h
+function print_usage {
+ echo "Usage: $0 [build | release | bump_version version ]"
+}
+
+function check_env {
+ if [ -z $LEVELDB_HOME ] ; then
+ echo "Expect LEVELDB_HOME to be SET"
+ exit 1
+ fi
+ if [ -z $JAVA_HOME ] ; then
+ export JAVA_HOME=/usr/local/jdk-6u14-64/
+ echo "JAVA_HOME not set. Assuming JAVA_HOME=$JAVA_HOME"
+ fi
+ if [ -z $LEVELDBJNI_HOME ] ; then
+ export LEVELDBJNI_HOME=$LEVELDB_HOME/java/leveldbjni/
+ echo "LEVELDBJNI_HOME not set. Assuming LEVELDBJNI_HOME=$LEVELDBJNI_HOME"
+ fi
+ if [ -z $SNAPPY_HOME ] ; then
+ export SNAPPY_HOME="/home/dhruba/snappy-1.0.5"
+ echo "SNAPPY_HOME not set. Assuming SNAPPY_HOME=$SNAPPY_HOME"
+ fi
+ if [ -z $LEVELDB_PATCH ] ; then
+ LEVELDB_PATCH=$LEVELDB_HOME/java/leveldbjni/db.h.patch
+ echo "LEVELDB_PATCH not set. Assuming LEVELDB_PATCH=$LEVELDB_PATCH"
+ fi
+}
+
+function build {
+ cd $LEVELDB_HOME
+ git apply $LEVELDB_PATCH
+ make clean libleveldb.a
+ cd $LEVELDB_HOME/java/leveldb/leveldb-api
+ mvn clean package
+ cd $LEVELDBJNI_HOME
+ mvn clean install -P linux64
+ cd $LEVELDB_HOME
+ git checkout $LEVELDB_HOME/include/leveldb/db.h
+}
+
+function release {
+ cd $LEVELDB_HOME
+ git apply $LEVELDB_PATCH
+ make clean libleveldb.a
+ cd $LEVELDB_HOME/java/leveldb/leveldb-api
+ mvn clean package
+ cd $LEVELDBJNI_HOME
+ mvn deploy -P linux64 -DskipTests
+ cd $LEVELDB_HOME
+ git checkout $LEVELDB_HOME/include/leveldb/db.h
+}
+
+CMD=$1
+if [ -z $CMD ]; then
+ print_usage
+ exit 1
+fi
+
+case "$CMD" in
+ build)
+ check_env
+ build
+ ;;
+ bump_version)
+ if [ -z $2 ] ; then
+ echo "bump_version requires a version.no parameter at the end"
+ exit 1
+ fi
+ check_env
+ VERSION=$2
+ pushd $LEVELDBJNI_HOME
+ mvn versions:set -DnewVersion="$VERSION"
+ popd
+ echo "VERSION SET TO $VERSION"
+ ;;
+ release)
+ check_env
+ pushd $LEVELDBJNI_HOME
+ release
+ popd
+ ;;
+ *)
+ print_usage
+ exit 1
+ ;;
+esac
diff --git a/java/leveldbjni/leveldbjni-all/pom.xml b/java/leveldbjni/leveldbjni-all/pom.xml
index e5b3f8e06..9afd112e4 100755
--- a/java/leveldbjni/leveldbjni-all/pom.xml
+++ b/java/leveldbjni/leveldbjni-all/pom.xml
@@ -34,43 +34,43 @@
4.0.0
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni-project
- 99-master-SNAPSHOT
+ 1.5.6
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni-all
- 99-master-SNAPSHOT
+ 1.5.6
${project.artifactId}
An uber jar which contains all the leveldbjni platform libraries and dependencies
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni-osx
- 99-master-SNAPSHOT
+ 1.5.6
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni-linux32
- 99-master-SNAPSHOT
+ 1.5.6
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni-linux64
- 99-master-SNAPSHOT
+ 1.5.6
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni-win32
- 99-master-SNAPSHOT
+ 1.5.6
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni-win64
- 99-master-SNAPSHOT
+ 1.5.6
diff --git a/java/leveldbjni/leveldbjni-linux32/pom.xml b/java/leveldbjni/leveldbjni-linux32/pom.xml
index 366cf696c..3647cfd80 100755
--- a/java/leveldbjni/leveldbjni-linux32/pom.xml
+++ b/java/leveldbjni/leveldbjni-linux32/pom.xml
@@ -34,23 +34,23 @@
4.0.0
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni-project
- 99-master-SNAPSHOT
+ 1.5.6
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni-linux32
- 99-master-SNAPSHOT
+ 1.5.6
${project.artifactId}
The leveldbjni linux 32 native libraries
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni
- 99-master-SNAPSHOT
+ 1.5.6
@@ -82,7 +82,7 @@
leveldbjni
false
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni
${project.version}
native-src
diff --git a/java/leveldbjni/leveldbjni-linux64/pom.xml b/java/leveldbjni/leveldbjni-linux64/pom.xml
index e63d6f87f..9f0bf6d25 100755
--- a/java/leveldbjni/leveldbjni-linux64/pom.xml
+++ b/java/leveldbjni/leveldbjni-linux64/pom.xml
@@ -34,23 +34,23 @@
4.0.0
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni-project
- 99-master-SNAPSHOT
+ 1.5.6
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni-linux64
- 99-master-SNAPSHOT
+ 1.5.6
${project.artifactId}
The leveldbjni linux 64 native libraries
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni
- 99-master-SNAPSHOT
+ 1.5.6
@@ -81,7 +81,7 @@
leveldbjni
false
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni
${project.version}
native-src
diff --git a/java/leveldbjni/leveldbjni-osx/pom.xml b/java/leveldbjni/leveldbjni-osx/pom.xml
index cf31b8be5..16c9c303f 100755
--- a/java/leveldbjni/leveldbjni-osx/pom.xml
+++ b/java/leveldbjni/leveldbjni-osx/pom.xml
@@ -34,29 +34,29 @@
4.0.0
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni-project
- 99-master-SNAPSHOT
+ 1.5.6
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni-osx
- 99-master-SNAPSHOT
+ 1.5.6
${project.artifactId}
The leveldbjni OS X universal native libraries
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni
- 99-master-SNAPSHOT
+ 1.5.6
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni
- 99-master-SNAPSHOT
+ 1.5.6
test-jar
test
@@ -90,7 +90,7 @@
leveldbjni
false
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni
${project.version}
native-src
diff --git a/java/leveldbjni/leveldbjni-win32/pom.xml b/java/leveldbjni/leveldbjni-win32/pom.xml
index 1defb4667..f9d43efaf 100755
--- a/java/leveldbjni/leveldbjni-win32/pom.xml
+++ b/java/leveldbjni/leveldbjni-win32/pom.xml
@@ -34,23 +34,23 @@
4.0.0
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni-project
- 99-master-SNAPSHOT
+ 1.5.6
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni-win32
- 99-master-SNAPSHOT
+ 1.5.6
${project.artifactId}
The leveldbjni Windows 32 bit native libraries
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni
- 99-master-SNAPSHOT
+ 1.5.6
@@ -82,7 +82,7 @@
leveldbjni
false
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni
${project.version}
native-src
diff --git a/java/leveldbjni/leveldbjni-win64/pom.xml b/java/leveldbjni/leveldbjni-win64/pom.xml
index 7f3aa6bc2..fda55111b 100755
--- a/java/leveldbjni/leveldbjni-win64/pom.xml
+++ b/java/leveldbjni/leveldbjni-win64/pom.xml
@@ -34,23 +34,23 @@
4.0.0
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni-project
- 99-master-SNAPSHOT
+ 1.5.6
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni-win64
- 99-master-SNAPSHOT
+ 1.5.6
${project.artifactId}
The leveldbjni Windows 64 bit native libraries
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni
- 99-master-SNAPSHOT
+ 1.5.6
@@ -81,7 +81,7 @@
leveldbjni
false
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni
${project.version}
native-src
diff --git a/java/leveldbjni/leveldbjni/pom.xml b/java/leveldbjni/leveldbjni/pom.xml
index ed20218c9..f5a2f7acd 100755
--- a/java/leveldbjni/leveldbjni/pom.xml
+++ b/java/leveldbjni/leveldbjni/pom.xml
@@ -34,14 +34,14 @@
4.0.0
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni-project
- 99-master-SNAPSHOT
+ 1.5.6
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni
- 99-master-SNAPSHOT
+ 1.5.6
jar
${project.artifactId}
diff --git a/java/leveldbjni/pom.xml b/java/leveldbjni/pom.xml
index 6a0e0587a..f059326c6 100755
--- a/java/leveldbjni/pom.xml
+++ b/java/leveldbjni/pom.xml
@@ -39,9 +39,9 @@
1.9
- org.fusesource.leveldbjni
+ org.fusesource.leveldbjni.fb
leveldbjni-project
- 99-master-SNAPSHOT
+ 1.5.6
pom
${project.artifactId}
@@ -53,6 +53,14 @@
UTF-8
1.6
0.4
+ nexus.vip.facebook.com:8181
+ 1.7
+
+ http://${project.nexus.hostPort}/nexus/content/repositories/libs-releases-local
+
+
+ http://${project.nexus.hostPort}/nexus/content/repositories/libs-snapshots-local
+
@@ -95,11 +103,14 @@
-
- website.fusesource.org
- website
- dav:http://fusesource.com/forge/dav/${forge-project-id}/maven/${project.version}
-
+
+ libs-releases-local
+ ${project.libs-releases-local-url}
+
+
+ libs-snapshots-local
+ ${project.libs-snapshots-local-url}
+
@@ -141,6 +152,15 @@
+
+ org.apache.maven.plugins
+ maven-release-plugin
+ 2.3.1
+
+ false
+ true
+
+
org.apache.maven.plugins
maven-surefire-plugin