(This seems like a pretty simple problem, but got stuck for 2 days :()
I have a runnable jar (created using the maven assembly plugin ). The class inside the jar looks for the xml file in the classpath. However, we do not want to link the XML file in the bank and want it to be external.
Tried so far:
==> not loading (conf folder contains xml)
Set classpath in assembler plugin
<plugin> <artifactId>maven-assembly-plugin</artifactId> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> <configuration> <archive> <manifest> <mainClass>com.xxx.Test</mainClass> <addClasspath>true</addClasspath> <classpathPrefix>./conf/</classpathPrefix> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> </plugin>
==> does not add ClassPath to MANIFEST.MF in runnable jar
Edit:
Generated by MAINFEST.MF in the bank:
Manifest-Version: 1.0 Archiver-Version: Plexus Archiver Created-By: Apache Maven Built-By: xxx Build-Jdk: 1.7.0_21 Main-Class: com.xxx.Test
Edit 2 :
So, I edited the generated MANIFEST in the bank and the recreated bank. Still not finding xml!
Manifest-Version: 1.0 Archiver-Version: Plexus Archiver Created-By: Apache Maven Built-By: xxx Build-Jdk: 1.7.0_21 Main-Class: com.xxx.Test Class-Path: .
java xml jar maven
gammay
source share