i have a few batch java command-line applications which are planned to be deployed as:
batch_apps app_1 batch1.jar run_batch1.sh app_2 batch2.jar run_batch3.sh {...etc...}
what would be the best practice on organizing a shared library pool – for example log4j:
batch_apps app_1 batch1.jar run_batch1.sh app_2 batch2.jar run_batch3.sh libs log4j.jar ojdbc.jar
?
and include individual log4j.xml’s in each app’s own jar file? i understand i would need to add ‘libs’ to the classpath either in manifests or in run_batchX.sh (which way is preferable?)
I am mostly wondering what would be the most efficient setup performance-wise.
thanks
Having a shared libs directory at the root of your install dir is definitely the way to go. Since libs will be loaded in memory once, when the JVM launches, there is no impact on performance whatever solution you choose.
I would not put the classpath in the jar files, as this would force you to change your jars if you need to relocate your lib dir. Editing a script is much simpler.
I would not include the log4j conf file in your jar files either, for the same reason.