You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Enda Ridge <ER...@cs.york.ac.uk> on 2006/10/30 18:35:00 UTC

executable jar with all dependencies

Hi,
I'd be grateful for help with the following please.
I've looked at similar threads but cannot get the results to apply in my 
own circumstances.

I am using Maven2 with a multiple module project. The package command 
works fine, placing a jar in each module's target directory.

I would like to produce a single executable jar for the whole project, 
including all dependent jars from my repository and all generated jars 
from my own project.

I've seen posts mentioning the assembly and jar plugins but cannot find 
any instructions on the project's web site.

Thanks in advance,
Enda

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


Re: executable jar with all dependencies

Posted by John Casey <ca...@gmail.com>.
You might start by looking here:

http://maven.apache.org/plugins/maven-assembly-plugin

You might be able to achieve this using the built-in jar-with-dependencies
descriptorRef, along with a custom manifest entry...for the manifest
customizations, you could add this to the assembly plugin configuration:

<configuration>
  <archive>
    <manifest>
      <mainClass>some.class.Main</mainClass>
    </manifest>
  </archive>
</configuration>

If the jar-with-dependencies assembly type doesn't work, you might have to
create your own assembly descriptor, specify a dependencySet within that,
and specify <unpack>true</unpack>.

HTH,

John

On 10/30/06, Enda Ridge <ER...@cs.york.ac.uk> wrote:
>
> Hi,
> I'd be grateful for help with the following please.
> I've looked at similar threads but cannot get the results to apply in my
> own circumstances.
>
> I am using Maven2 with a multiple module project. The package command
> works fine, placing a jar in each module's target directory.
>
> I would like to produce a single executable jar for the whole project,
> including all dependent jars from my repository and all generated jars
> from my own project.
>
> I've seen posts mentioning the assembly and jar plugins but cannot find
> any instructions on the project's web site.
>
> Thanks in advance,
> Enda
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>