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....@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-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to