5.3.10

A little jar hell

OpenIM is a Jabber Server written in Java. It uses maven to solve dependencies.
Maven is great, when you have an internet connection, but I have to put OpenIM in a private Lan without internet access.
So i googled for a method for the export of a maven project with all of its dependencies; but I was unlucky.
I know that maven put all downloaded jars in ~/.m2 directory.
So I temporary renamed my .m2/ and mvn install as described in OpenIM documentation.
With a directory full of jars, I want to collect all files in a directory so I did a bash script to do so:
cd .m2/repository/
find `pwd` -print | grep '.jar' | grep -v '.sha1' | grep -v '.md5' >> ~/templist.txt
cd
mkdir tempjars
cat ~/templist.txt | while read LINE do
    cp $LINE tempjars/
done
rm ~/templist.txt


And I prepared a script to run the server (to be placed in the same dir of the jars):
$JAVA_HOME/bin/java -classpath $(echo *.jar . | sed 's/ /:/g') -jar pomstrap-1.0.7.jar net.java.dev.openim:openim-plexus-server:1.5 net.java.dev.openim.App:launch

And that's all.

Nessun commento:

Posta un commento

Hello, new comment!

Warning

My first language isn't english. Feel free to gently correct my words. :)
Powered By Blogger