maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Earl.Bennett" <earl.benn...@compuware.com>
Subject Can't set Class-Path in jar using external manifest file
Date Thu, 09 Jan 2014 17:49:45 GMT
I've been going around and around with this one for a few hours now.

I am using Maven 3.1.1

I created a jar file, and had the maven-jar-plugin generate the manifest
file with the classPath for me. I am then able to sucessfully execute the
jar file with java -jar.

I then exported the manifest from the jar file to a file. I modified the
pom.xml to not generate the classpath automatically, but to use the external
manifest file I created.  When I try to run the resulting jar file using
java -jar, I get a class not found extension. After some testing, I have
concluded that the classpath in the manifest file is not being read.

I exported the manifest from the non-working jar file to a second file.  I
then compared the two files. The files are identical except for the position
of the Built-By and Build-Jdk elements. In the maven generated manifest,
these lines appear before the class path. In the manifest generated from the
external file, these lines appear after the class path, even though they are
defined before the class path in my external manifest file.

The Class-Path elements themselves are identical!!

The elements in the manifest are not supposed to be order sensitive as far
as I know.

So, I am at a loss.  I need to be able to define the classpath using an
external manifest file because I need to be able to add directories to it,
and I need to be able to control the order of the jar files in the
classpath.

I would very much appreciate any thoughts anyone may have on this.

Earl




--
View this message in context: http://maven.40175.n5.nabble.com/Can-t-set-Class-Path-in-jar-using-external-manifest-file-tp5781041.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message