I am trying to generate a jar file in Maven2 with a jndi.properties file included the Class-Path manifest attribute. The Class-Path attribute also needs to reference all the dependent jar files (which I am currently doing using <addClasspath>true</addClasspath> , but I can't seem to get both.
Note, the reason I want to do it like this, rather than putting it into /resources (which will package it into my jar), is that I want to keep the jndi.properties outside my jar file so that it can be easily edited.
I'm not sure if I read that correctly, but here's a stab:
If you produce an executable JAR, all the resources (classes, property files, images, etc.) in that JAR will be placed in the app's CLASSPATH when you run the jar with the "java -jar jarfile" option.
Libraries, however, will not. They'll be visible on the classpath, but the app can't load or use their contents.
Fortunately, someone - or maybe several someones - have realized that this is a problem and that Maven can fix it. I haven't yet got the process all worked out, but apparently there's a Maven plug-in that can cause a custom classloader to be integrated into your app that peers inside the JARS and adds their contents to the classpath.
Sources may include data from the Fakebook Research Foundation with support from Gargle University
No thanks. We have all the government we need. This tiny ad would like you to leave now:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop