atom feed5 messages in org.apache.maven.usersRe: Shade plugin: including system-sc...
FromSent OnAttachments
Jan T. KimJul 9, 2010 7:19 am 
Jörg SchaibleJul 9, 2010 7:44 am 
Jan T. KimJul 9, 2010 9:18 am 
Wayne FayJul 9, 2010 11:11 am 
Jan T. KimJul 9, 2010 1:13 pm 
Subject:Re: Shade plugin: including system-scoped dependencies?
From:Jan T. Kim (j.k@uea.ac.uk)
Date:Jul 9, 2010 9:18:59 am
List:org.apache.maven.users

On Fri, Jul 09, 2010 at 03:44:21PM +0100, J??rg Schaible wrote:

Jan T. Kim wrote:

Dear All,

is it possible to include system-scoped dependencies in a shaded jar? My dependencies look like this:

<dependency> <groupId>jboss-stuff</groupId> <artifactId>jbossall-client</artifactId> <version>5.1</version> <scope>system</scope> <systemPath>${jbosshome}/client/jbossall-client.jar</systemPath> </dependency>

I've tried adding

<artifactSet> <includes> <include>jboss-stuff:*</include> </includes> </artifactSet>

but the contents of jbossall-client.jar still don't get included in the shaded jar.

Am I just making a stupid mistake? Or are system-scoped dependencies always excluded from shaded jars?

This jbossall-client.jar contains only a manifest, so what do you expect ?

That's a valid point -- I hadn't noticed that the jbossall-client file is empty these days. Apologies for providing a bad example and thanks for looking into this.

Not all jboss-stuff jars are empty, here's another example dependency:

<dependency> <groupId>jboss-stuff</groupId> <artifactId>jnpserver</artifactId> <version>5.1</version> <scope>system</scope> <systemPath>${jbosshome}/common/lib/jnpserver.jar</systemPath> </dependency>

This time I checked that that's not an empty jar:

% jar tvf jnpserver.jar [...] 0 Mon May 11 16:47:10 BST 2009 org/ 0 Mon May 11 16:47:10 BST 2009 org/jboss/ 0 Mon May 11 16:47:10 BST 2009 org/jboss/naming/ 0 Mon May 11 16:47:10 BST 2009 org/jnp/ 0 Mon May 11 16:47:10 BST 2009 org/jnp/client/ 0 Mon May 11 16:47:10 BST 2009 org/jnp/interfaces/ 0 Mon May 11 16:47:10 BST 2009 org/jnp/interfaces/java/ 0 Mon May 11 16:47:10 BST 2009 org/jnp/interfaces/jnp/ 0 Mon May 11 16:47:10 BST 2009 org/jnp/server/ 2792 Mon May 11 16:47:10 BST 2009 org/jboss/naming/BindingsInitializer.class [...]

So I'm trying to get org/jboss/naming/BindingsInitializer.class etc. included in the shaded jar.

As a bit of background, this is for a command line app. Currently, I've put the jboss jars that that app depends on into the Class-Path entry in the jar's manifest. Obviously, that works only as long as the absolute paths to the jars are the same on all machines the app is used on. However, that's no longer the case, so now I'm trying to get the jar to include the stuff it depends on. If anyone has a suggestion for solving this in a more elegant way, I'd be interested.

Best regards, Jan