Hi Kevin,
It is possible to have the master jar reference other JARs, using the
Class-Path: entry in its META-INF/MANIFEST.MF file. For details, see [1]
A separate problem is how to create the different JARs in the first
place. Maven works best when you arrange it such that each module
creates a single artifact. So I think you could create new plugins to
represent aech the different bits of the JAR that you want, and use the
shade plugin just in these dependent modules but *not* for the module
that will have the customised manifest.
HTH
Dan
[1] http://download.oracle.com/javase/tutorial/deployment/jar/downman.html
~~~~~~~~
On 25/05/2011 19:35, Kevin Meyer - KMZ wrote:
Hi,
I've been banging my head against this - can someone tell me how to
split a master jar into two (or three) pieces?
The maven shade plugin helps create a master jar (or war) that can be
run with "java -jar xxx.jar" (e.g. running the todo html viewer project).
I've tested this, and as long as there is a "src/main/resources" that
contains the "WEB-INF" directory (and its contents), this works fine.
But for upgrade purposes, I'd like to split this jar into 3: 1 contains all
the "other" dependencies, 1 contains the "isis" classes, and the final
contains the application "domain" classes. Then I can easily replace
just the "domain.jar" as I update my application domain design...
I thought it'd be as simple as making three copies of the master jar
and deleting the "other" bits from each one (i.e. "isis.jar" contains only
the meta-inf directory and the "isis" directory, "dom.jar" contains only
the application domain directories, and "others.jar" contains the rest).
Then execution could be as simple as:
"java -cp others.jar:dom.jar -jar isis.jar"
But this fails almost immediately with an unable to find class error
while looking for google's commons List class (which is now in
"others.jar").
Any words of advice?
Regards,
Kevin