maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jan T. Kim" <j....@uea.ac.uk>
Subject Re: Shade plugin: including system-scoped dependencies?
Date Fri, 09 Jul 2010 16:18:59 GMT
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
-- 
 +- Jan T. Kim -------------------------------------------------------+
 |             email: j.kim@uea.ac.uk                                 |
 |             WWW:   http://www.cmp.uea.ac.uk/people/jtk             |
 *-----=<  hierarchical systems are for files, not for humans  >=-----*

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


Mime
View raw message