You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Eric Weiss <we...@llnl.gov> on 2005/07/15 22:58:47 UTC

How to include dependencies when building/installing a .jar ???

Maven2
m2 clean:clean install
packaging = jar

I am trying to build a jar file, myJar.jar.  myJar has several other jar 
files in it's dependency list in the pom.xml.  I need to deploy this .jar 
file to a server, but I also need the dependency jars with it...either in 
the same folder or in a lib folder.
Is there an easy/built in way to include the dependency jar files when 
building a jar package?  Or do I need to build my own plugin?

Thx,
Eric



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


Re: How to include dependencies when building/installing a .jar ???

Posted by Eric Weiss <we...@llnl.gov>.
Thx all for the responses.

Yes, it does sound like an .ear/.war, but I don't have a web.xml file and 
it is not a web based app destined for a container.  Actually, I am trying 
to deploy an app to an Apache JAMES server.  I need a bunch of my own 
classes as well as many dependent jars put into a couple of different 
directories under JAMES.  I am ok with having to manually put the files in 
place, but I need to get M2 to package them all up into a single "tarball" 
so I can 1) move it to the server, 2) get everything I need in one file for 
later extraction.

Someone mentioned using the assembly plugin, which I tried, but couldn't 
get to work.  I will try again and post the error I am getting.

Great suggestions, thx for the help everyone!

Eric


At 06:57 PM 7/15/2005, Matthew L Daniel wrote:
> > Is there an easy/built in way to include the dependency jar files when
> > building a jar package?  Or do I need to build my own plugin?
>
>Sounds suspiciously like an EAR to me. If you ignore the
>META-INF/application.xml, it's a zip file with all your jars packaged
>together. That said, if you're "deploying" to a server, chances are you
>would really want to use the actual deployed artifact type (war is
>another that will do this).
>
>   My USD$0.02,
>   -- /v\atthew
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org

Eric Weiss
email: weiss7@llnl.gov
office: 925.422.4238
icq:    321045132



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


Re: How to include dependencies when building/installing a .jar ???

Posted by Henry Isidro <hi...@exist.com>.
Matthew L Daniel wrote:

>>Is there an easy/built in way to include the dependency jar files when 
>>building a jar package?  Or do I need to build my own plugin?
>>    
>>
>
>Sounds suspiciously like an EAR to me. If you ignore the
>META-INF/application.xml, it's a zip file with all your jars packaged
>together. That said, if you're "deploying" to a server, chances are you
>would really want to use the actual deployed artifact type (war is
>another that will do this).
>
>  My USD$0.02,
>  -- /v\atthew
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>
>  
>
I agree...if you make a WAR, you can include the dependencies into the 
package by setting the war.bundle property of the dependency in the pom 
to true.

- henry

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


Re: How to include dependencies when building/installing a .jar ???

Posted by Brett Porter <br...@gmail.com>.
You can use the assembly plugin to create a single distributable unit.
It will create a tarball, zip, or jar from your project and
dependencies.

- Brett

On 7/16/05, Matthew L Daniel <md...@scdi.com> wrote:
> > Is there an easy/built in way to include the dependency jar files when
> > building a jar package?  Or do I need to build my own plugin?
> 
> Sounds suspiciously like an EAR to me. If you ignore the
> META-INF/application.xml, it's a zip file with all your jars packaged
> together. That said, if you're "deploying" to a server, chances are you
> would really want to use the actual deployed artifact type (war is
> another that will do this).
> 
>   My USD$0.02,
>   -- /v\atthew
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
>

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


Re: How to include dependencies when building/installing a .jar ???

Posted by Matthew L Daniel <md...@scdi.com>.
> Is there an easy/built in way to include the dependency jar files when 
> building a jar package?  Or do I need to build my own plugin?

Sounds suspiciously like an EAR to me. If you ignore the
META-INF/application.xml, it's a zip file with all your jars packaged
together. That said, if you're "deploying" to a server, chances are you
would really want to use the actual deployed artifact type (war is
another that will do this).

  My USD$0.02,
  -- /v\atthew

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


Re: How to include dependencies when building/installing a .jar ???

Posted by Allan Ramirez <ar...@exist.com>.
Eric Weiss wrote:

>
> Maven2
> m2 clean:clean install
> packaging = jar
>
> I am trying to build a jar file, myJar.jar.  myJar has several other 
> jar files in it's dependency list in the pom.xml.  I need to deploy 
> this .jar file to a server, but I also need the dependency jars with 
> it...either in the same folder or in a lib folder.
> Is there an easy/built in way to include the dependency jar files when 
> building a jar package?  Or do I need to build my own plugin?
>
> Thx,
> Eric
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
There's a plugin for that in M1 called "maven-uberjar-plugin". It is not 
available right now in M2,
but if you want you can create a plugin for that.. :D

-allan

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