Symlink Jar with Classpath based deployment causing issues
Hi,
I'm trying to deploy a fairly complex code base in a reliable manner onto a system using Ant which allows Rollback functionality in the event of a failure.
I have a pair of directories;
/var/distributions/
/var/www/lib/java/
using symlinks to do the following:
/var/www/lib/java/CORE.jar -> /var/distributions/CORE_1.203.jar
this provides a means to rollback without needing to alter any configuration files, as all that needs changing is the symlink to point at a different core version.
However, Java is stupid.
calling java -jar /var/www/lib/java/CORE.jar
results in a failure to find the lib folder contained within /java/ as the manifest file within Core points in a relative manner to ./lib/, which java interprets as relative to the distributions folder rather than the java folder being executed from. I do not wish to have the lib folder in the distributions folder as this makes no sence, and ideally want the lib to be kept in
/var/www/lib/java/lib
with the classpath pointing to this folder. However, java -jar X -cp Y is useless as Suns wisdom back in 1.3 was "people may use -cp without realising it doesnt work and so we wont make it work incase it breaks their code".
So... my questions are:
1) is there a way of using sym links to have external jars being called whos MANIFEST.MF is relative to the JVMs start directory
2) is there a way of making a MANIFEST.MF use a runtime supplied Classpath
3) is there a way of forcing java to use the path running from and not the symlinked dir
Please help, this is driving me mad
Warmfusion

