9/05/2014

Building and installing Apache Karaf from sources (no sudo needed)

Once upon a time I was working for a company where sudo rights weren't given to developers. So I had to spend a significant fraction of my time finding workarounds, how silly is that. The no-sudo-needed series is the result of all these efforts: I've saved the process, so next time it is needed, it's easy to get back to it.

The point here is to be able to install them just by copying and pasting the code below. Things change around us though, so whatever may build today might just stop working tomorrow. Thus I do my best to keep these code snippets up-to-date.

Like today I need Karaf again. Building from source feels very appropriate, so even though I have sudo on my computers since leaving that company, I still keep coming back here for the "easy builds". Today I updated with Karaf 2.3.11, it is currently building in another window. If succeeds, I'll create another snippet for it. If you need it, feel free to get it!

Building Apache Karaf 2.3.11 from sources

wget http://apache.belnet.be/karaf/2.3.11/apache-karaf-2.3.11-src.tar.gz
tar xvzf apache-karaf-2.3.11-src.tar.gz
cd apache-karaf-2.3.11/src
mvn clean install -DskipTests
mv assemblies/apache-karaf/target/apache-karaf-2.3.11.tar.gz ~/tools
cd ~/tools
tar xvzf apache-karaf-2.3.11.tar.gz
ln -s apache-karaf-2.3.11 karaf

Building Apache Karaf 2.3.6 from sources

wget http://apache.belnet.be/karaf/2.3.6/apache-karaf-2.3.6-src.tar.gz
tar xvzf apache-karaf-2.3.6-src.tar.gz
cd apache-karaf-2.3.6/src
mvn clean install -DskipTests
mv assemblies/apache-karaf/target/apache-karaf-2.3.6.tar.gz ~/tools
cd ~/tools
tar xvzf apache-karaf-2.3.6.tar.gz
ln -s apache-karaf-2.3.6 karaf

Building Apache Karaf 4.0 from sources

git clone https://git-wip-us.apache.org/repos/asf/karaf.git
cd karaf
git checkout karaf-4.0.0
# to avoid "Detected JDK Version: 1.6.0-65 is not in the allowed range [1.7,1.9)" on osx, can only build with 1.7
export JAVA_HOME=`/usr/libexec/java_home -v 1.7`
mvn clean install -DskipTests

No comments:

Post a Comment