You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Chen, Andrew ." <Ch...@westinghouse.com> on 2005/01/28 22:35:51 UTC

How to make executable jar file with dependency?

Hi,

Our codes depend on some external libraries, such as xerces.jar, xalan.jar,
..

How to make an executable jar that include everything?

My end command is expected to be:
 java -jar myprj.jar 

What is the best practice in Maven to deploy pure non-j2ee java code?
Should I pack everything into one big jar, or deploy all different jar files
into one directory?

We have tried the manifest in project.properties, and the resource in
project.xml.

Thanks
Andrew H. Chen
Engineering Computing & US BWR
Westinghouse Electric Company

(+1)-412-374-2316

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


Re: How to make executable jar file with dependency?

Posted by Andy Lawrence <al...@medplus.com>.
I've had better luck with this:
http://maven-plugins.sourceforge.net/maven-javaapp-plugin/index.html

with uberjar, it packaged just fine, but there was a *long* delay in
starting up.  I don't exactly remember the reasons anymore, but
basically, to get dependent jars into your classpath (and those jars are
inside your uberjar) they use a custom classloader to do the trickery.

javaapp works a bit differently to make the classpath work:  at
generation time, it unpacks ALL of the dependent jars into one big tree,
and then jars that up.

HTH

On Fri, 2005-01-28 at 20:47 -0100, Pascal Thivent wrote:

> Hi,
> 
> I think this is what you're looking for :
> http://maven.apache.org/reference/plugins/uberjar/
> 
> On Fri, 28 Jan 2005 16:35:51 -0500, Chen, Andrew .
> <Ch...@westinghouse.com> wrote:
> > Hi,
> > 
> > Our codes depend on some external libraries, such as xerces.jar, xalan.jar,
> > ..
> > 
> > How to make an executable jar that include everything?
> > 
> > My end command is expected to be:
> >  java -jar myprj.jar
> > 
> > What is the best practice in Maven to deploy pure non-j2ee java code?
> > Should I pack everything into one big jar, or deploy all different jar files
> > into one directory?
> > 
> > We have tried the manifest in project.properties, and the resource in
> > project.xml.
> > 
> > Thanks
> > Andrew H. Chen
> > Engineering Computing & US BWR
> > Westinghouse Electric Company
> > 
> > (+1)-412-374-2316
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> > 
> > 
> 

Re: How to make executable jar file with dependency?

Posted by Pascal Thivent <pa...@gmail.com>.
Hi,

I think this is what you're looking for :
http://maven.apache.org/reference/plugins/uberjar/

On Fri, 28 Jan 2005 16:35:51 -0500, Chen, Andrew .
<Ch...@westinghouse.com> wrote:
> Hi,
> 
> Our codes depend on some external libraries, such as xerces.jar, xalan.jar,
> ..
> 
> How to make an executable jar that include everything?
> 
> My end command is expected to be:
>  java -jar myprj.jar
> 
> What is the best practice in Maven to deploy pure non-j2ee java code?
> Should I pack everything into one big jar, or deploy all different jar files
> into one directory?
> 
> We have tried the manifest in project.properties, and the resource in
> project.xml.
> 
> Thanks
> Andrew H. Chen
> Engineering Computing & US BWR
> Westinghouse Electric Company
> 
> (+1)-412-374-2316
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 

-- 
Pascal

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