maven - Error trying to adding arbitrary classpath in Manifest.mf -
i have code add classpath:
<plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-jar-plugin</artifactid> <version>2.4</version> <configuration> <archive> <manifest> <adddefaultimplementationentries>true</adddefaultimplementationentries> <addclasspath>true</addclasspath> <mainclass>apuestaya</mainclass> </manifest> <manifestentries> <class-path>../lib/jcalendar.jar ../lib/eclipselink.jar ../lib/libforms-1.3.0.jar ../lib/imagenes.jar ../lib/driverpersistencia.jar ../lib/javax.persistence_2.0.3.v201010191057.jar</class-path> </manifestentries> </archive> </configuration> </plugin>
but got in manifest.mf:
manifest-version: 1.0 implementation-title: apuestaya implementation-version: 0.9.0-snapshot implementation-vendor-id: um.tds.victormruiz built-by: celor build-jdk: 1.7.0_09 class-path: ../lib/jcalendar.jar ../lib/eclipselink.jar ../lib/libform s-1.3.0.jar ../lib/imagenes.jar ../lib/driverpersistencia.jar ../lib/ javax.persistence_2.0.3.v201010191057.jar created-by: apache maven 3.0.4 main-class: apuestaya archiver-version: plexus archiver
as can see, maven put random blank spaces in jar's routes. example: ../lib/libform s-1.3.0.jar ... so, when lunch mi jar error because can't find jars. ideas?
a workaround
use version 2.3.2 of maven-jar-plugin , change configuration of class-path.
<class-path><![cdata[../lib/jcalendar.jar ../lib/eclipselink.jar ../lib/libforms-1.3.0.jar ../lib/imagenes.jar ../lib/driverpersistencia.jar ../lib/javax.persistence_2.0.3.v201010191057.jar]]></class-path>
it make classpath multi line, remember spaces @ start of each line. according jar specification, manifest line can have @ 72 bytes.
Comments
Post a Comment