Everyone should be used to using Classes that are grouped into libraries.


Jan T. Kim wrote:
Dear All,

I need to build a standalone executable jar and have the following
difficulties:

    * the app needs a bunch of classes from another module
break the other module into a jar that contains the sharable classes and an application that depends on that jar
    * the app needs classes provided by non-Maven jars
Get Nexus and load the non-Maven, non-yours jars into your Maven repository.
This leads me to these questions:

    (1) How can I include classes from other modules in my jar?

Build a jar with just the common classes.
    (2) How can I add arbitrary jars, in arbitrary directories, to my
      Class-Path entry in my jar?

Use maven to define your dependencies as dependencies in your pom
(1) has been my usual solution to the problem that classes cannot be
provided by jars inside jars, but if it's possible to include the
absolute paths to jars built by other modules that would probably be
ok.

Not a good idea. just declare your dependencies.
(2) referencing those other jars by absolute path would be ok for
my purpose.

Use Maven to define your jars. Do not try to tell maven absolute paths.
I guess my general question is: How do you build standalone executable
jars that don't depend on other jars moving along with them?

You create jars that include all of the dependencies that are required.
Best regards, Jan


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

Reply via email to