Last Updated: February 25, 2016
·
3.999K
· etsauer

Find the version of Apache Axis from jar file

Had to do some investigating at a customer site that had some old apache axis running, and we wanted the version so we could try to "mavenize" the app. Here is the process we went through to find it. Axis packages a Version class, with a main method that will spit out the version and build date by default. In order to get it to run in the command line we had to resolve several dependencies:

$ java -cp ./jboss/server/default/lib/axis.jar org.apache.axis.Version
Exception in thread "main" java.lang.NoClassDefFoundError: org.apache.commons.logging.LogFactory

So, one by one, we used a jar search to find and resolve dependencies:

$ find ./jboss/server/ -name "*.jar" -exec grep -Hsli LogFactory {} \;
./jboss/server/default/lib/commons-logging.jar
$ java -cp ./jboss/server/default/lib/axis.jar:./jboss/server/CCDb/lib/commons-logging.jar: org.apache.axis.Version
$ ... and so on....

Eventually, all dependencies resolve and we get our version.:

$ java -cp ./jboss/server/default/lib/axis.jar:./jboss/server/default/lib/commons-logging.jar:./jboss/server/default/lib/commons-httpclient.jar:./jboss/server/default/tmp/deploy/tmp3647155339465300265CRM-myapp.ear-contents/ejb.jar-contents/commons-discovery-0.4.jar org.apache.axis.Version
Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)

...oy... so old..