You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Sagare, Vipul" <Vi...@tmobilebroadband.com> on 2006/12/31 00:11:22 UTC

Newbie question- 3rd party jars

 
After going through the book, I am trying to get one of our modules compile and package into jar. How do I include 3rd party Jars?   Here is my directory structure and pom.xml  
 
Seems to be very elementary but the examples I am coming across seems to be NOT real world cases.
 
Thank you for your help.
 
 
mymodule-
     -doc (not to be included in jar)
     -lib  (has third party jars from       1.  un-common vendors (say - somevendor.jar) ..AND 
                                                      2.   more common jars like xercesImpl.jar, log4j.jar
     -src  which has java sorce
     -somedir  (not to be included in built jar)
 
pom.xml-
 
<project xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                      http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.tmobile.app</groupId>
  <artifactId>MyModule</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>MY Module </name>
  <url>http://tempurl.com</url>
  <build>
  <sourceDirectory>./src</sourceDirectory>
  </build>
</project>

 

 
________________________________

From: Dennis Lundberg [mailto:dennisl@apache.org]
Sent: Sat 12/30/2006 8:21 AM
To: Maven Users List
Subject: Re: Sample/Best Practice for Maven 2 and WebLogic J2EE application.



Sagare, Vipul wrote:
> I am trying convert "ant" scripts for J2EE application (with JAR, WAR,
> EAR) to Maven 2.0.  We use WebLogic 8.1 SP4.  
>
> I have tough time finding "a complete" sample for J2EE project with
> source code.  I see several bits and pieces on several Maven related
> websites.  The documentation is poor at best.
>
> An example similar to Vincent Massol's Maven 1.1 article on O'Reilly
> (http://www.onjava.com/pub/a/onjava/2005/09/07/maven.html?page=1) would
> be great.
>
> Anybody successfully using Maven WebLogic-Plugin for creating EAR files
> for WL 8.1 SP4 (EJB 2.0)? (As we use appc)
>
> Your help is appreciated.
>
> Thanks
> Vipul

If you haven't read "Better Builds With Maven" I suggest you start with
that. It's great and it's available as a free download:

   http://www.mergere.com/m2book_download.jsp

--
Dennis Lundberg

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






Re: Newbie question- 3rd party jars

Posted by Wayne Fay <wa...@gmail.com>.
<confused>

Maven is widely accepted. And it is an open source product from Apache
(ASF). What specifically is your problem?

Wayne

On 12/31/06, Sagare, Vipul <Vi...@tmobilebroadband.com> wrote:
> Thank you all for your help.
>
> I guess, I have to wait until Maven becomes more widely accepted and becomes as open source product as ant or similar apache packages.
>
> Vipul.
>
>
> -----Original Message-----
> From: john.tolentino@gmail.com on behalf of John Tolentino
> Sent: Sat 12/30/2006 11:48 PM
> To: Maven Users List
> Subject: Re: Newbie question- 3rd party jars
>
> On 12/31/06, Sagare, Vipul <Vi...@tmobilebroadband.com> wrote:
> > Thank you for quick response.   Any way to do this by keeping lib directory?
>
> You can but users will always have to manually install the artifacts
> to their local repository. You can provide them with a batch file or
> script for this.
>
> Like what Wendy said, you'll benefit more though if you could setup an
> internal repo.
>
>
>  With several environments and different network zones across which
> builds are done (dev, QA, production),  the transition from ANT to
> Maven needs happen in more gradually to reduce the risk on quality of
> the software delivery.
>
> There are several projects that uses both Ant and Maven builds. They
> could live along with each other so you're not obligated to overhaul
> your projects in one go.
>
> >
> > In other words, without changing any directory structure, can I use Maven for full enterprise level J2EE application with EAR, JAR and WAR with WebLogic EJBs?
>
> Although you could stick with your existing directory structure,
> you'll benefit more if you'll follow the best practices that Maven
> suggests. Like with the 3rd party jars, you can create a script to
> regularly copy files into a Maven 2 directory structure (with Maven 2
> POMs) and have it built there. Use this until you're comfortable with
> your migration.
>
> >
> > Thanks,
> > Vipul
> >
> > ________________________________
> >
> > From: Wendy Smoak [mailto:wsmoak@gmail.com]
> > Sent: Sat 12/30/2006 10:36 PM
> > To: Maven Users List
> > Subject: Re: Newbie question- 3rd party jars
> >
> >
> >
> > On 12/30/06, Sagare, Vipul <Vi...@tmobilebroadband.com> wrote:
> > > Both.
> > >
> > > I would like them to be in the classpath and in jar as well.
> >
> > Normally you would install them in your local repository and then use
> > a <dependency> element in your pom.  If you're working with other
> > developers, you'll probably want to establish an internal/corporate
> > repository so that each developer doesn't have to install them
> > individually.
> >
> > Then you won't need that "lib" directory at all, the jars in your
> > local repository will be shared across all of your Maven-built
> > projects.
> >
> > To include jars within a jar, I don't see a way to convince the jar
> > plugin to do it:
> >    http://maven.apache.org/plugins/maven-jar-plugin/
> > but you can use the assembly plugin:
> >    http://maven.apache.org/plugins/maven-assembly-plugin/
> >
> > --
> > Wendy
> >
> > ---------------------------------------------------------------------
> > 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
> >
> >
>
> ---------------------------------------------------------------------
> 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
>
>

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


RE: Newbie question- 3rd party jars

Posted by "Sagare, Vipul" <Vi...@tmobilebroadband.com>.
Thank you all for your help.

I guess, I have to wait until Maven becomes more widely accepted and becomes as open source product as ant or similar apache packages.

Vipul.


-----Original Message-----
From: john.tolentino@gmail.com on behalf of John Tolentino
Sent: Sat 12/30/2006 11:48 PM
To: Maven Users List
Subject: Re: Newbie question- 3rd party jars
 
On 12/31/06, Sagare, Vipul <Vi...@tmobilebroadband.com> wrote:
> Thank you for quick response.   Any way to do this by keeping lib directory?

You can but users will always have to manually install the artifacts
to their local repository. You can provide them with a batch file or
script for this.

Like what Wendy said, you'll benefit more though if you could setup an
internal repo.


 With several environments and different network zones across which
builds are done (dev, QA, production),  the transition from ANT to
Maven needs happen in more gradually to reduce the risk on quality of
the software delivery.

There are several projects that uses both Ant and Maven builds. They
could live along with each other so you're not obligated to overhaul
your projects in one go.

>
> In other words, without changing any directory structure, can I use Maven for full enterprise level J2EE application with EAR, JAR and WAR with WebLogic EJBs?

Although you could stick with your existing directory structure,
you'll benefit more if you'll follow the best practices that Maven
suggests. Like with the 3rd party jars, you can create a script to
regularly copy files into a Maven 2 directory structure (with Maven 2
POMs) and have it built there. Use this until you're comfortable with
your migration.

>
> Thanks,
> Vipul
>
> ________________________________
>
> From: Wendy Smoak [mailto:wsmoak@gmail.com]
> Sent: Sat 12/30/2006 10:36 PM
> To: Maven Users List
> Subject: Re: Newbie question- 3rd party jars
>
>
>
> On 12/30/06, Sagare, Vipul <Vi...@tmobilebroadband.com> wrote:
> > Both.
> >
> > I would like them to be in the classpath and in jar as well.
>
> Normally you would install them in your local repository and then use
> a <dependency> element in your pom.  If you're working with other
> developers, you'll probably want to establish an internal/corporate
> repository so that each developer doesn't have to install them
> individually.
>
> Then you won't need that "lib" directory at all, the jars in your
> local repository will be shared across all of your Maven-built
> projects.
>
> To include jars within a jar, I don't see a way to convince the jar
> plugin to do it:
>    http://maven.apache.org/plugins/maven-jar-plugin/
> but you can use the assembly plugin:
>    http://maven.apache.org/plugins/maven-assembly-plugin/
>
> --
> Wendy
>
> ---------------------------------------------------------------------
> 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
>
>

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





Re: Newbie question- 3rd party jars

Posted by John Tolentino <jt...@apache.org>.
On 12/31/06, Sagare, Vipul <Vi...@tmobilebroadband.com> wrote:
> Thank you for quick response.   Any way to do this by keeping lib directory?

You can but users will always have to manually install the artifacts
to their local repository. You can provide them with a batch file or
script for this.

Like what Wendy said, you'll benefit more though if you could setup an
internal repo.


 With several environments and different network zones across which
builds are done (dev, QA, production),  the transition from ANT to
Maven needs happen in more gradually to reduce the risk on quality of
the software delivery.

There are several projects that uses both Ant and Maven builds. They
could live along with each other so you're not obligated to overhaul
your projects in one go.

>
> In other words, without changing any directory structure, can I use Maven for full enterprise level J2EE application with EAR, JAR and WAR with WebLogic EJBs?

Although you could stick with your existing directory structure,
you'll benefit more if you'll follow the best practices that Maven
suggests. Like with the 3rd party jars, you can create a script to
regularly copy files into a Maven 2 directory structure (with Maven 2
POMs) and have it built there. Use this until you're comfortable with
your migration.

>
> Thanks,
> Vipul
>
> ________________________________
>
> From: Wendy Smoak [mailto:wsmoak@gmail.com]
> Sent: Sat 12/30/2006 10:36 PM
> To: Maven Users List
> Subject: Re: Newbie question- 3rd party jars
>
>
>
> On 12/30/06, Sagare, Vipul <Vi...@tmobilebroadband.com> wrote:
> > Both.
> >
> > I would like them to be in the classpath and in jar as well.
>
> Normally you would install them in your local repository and then use
> a <dependency> element in your pom.  If you're working with other
> developers, you'll probably want to establish an internal/corporate
> repository so that each developer doesn't have to install them
> individually.
>
> Then you won't need that "lib" directory at all, the jars in your
> local repository will be shared across all of your Maven-built
> projects.
>
> To include jars within a jar, I don't see a way to convince the jar
> plugin to do it:
>    http://maven.apache.org/plugins/maven-jar-plugin/
> but you can use the assembly plugin:
>    http://maven.apache.org/plugins/maven-assembly-plugin/
>
> --
> Wendy
>
> ---------------------------------------------------------------------
> 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
>
>

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


RE: Newbie question- 3rd party jars

Posted by "Sagare, Vipul" <Vi...@tmobilebroadband.com>.
Thank you for quick response.   Any way to do this by keeping lib directory?    With several environments and different network zones across which builds are done (dev, QA, production),  the transition from ANT to Maven needs happen in more gradually to reduce the risk on quality of the software delivery.
 
In other words, without changing any directory structure, can I use Maven for full enterprise level J2EE application with EAR, JAR and WAR with WebLogic EJBs?
 
Thanks,
Vipul

________________________________

From: Wendy Smoak [mailto:wsmoak@gmail.com]
Sent: Sat 12/30/2006 10:36 PM
To: Maven Users List
Subject: Re: Newbie question- 3rd party jars



On 12/30/06, Sagare, Vipul <Vi...@tmobilebroadband.com> wrote:
> Both.
>
> I would like them to be in the classpath and in jar as well.

Normally you would install them in your local repository and then use
a <dependency> element in your pom.  If you're working with other
developers, you'll probably want to establish an internal/corporate
repository so that each developer doesn't have to install them
individually.

Then you won't need that "lib" directory at all, the jars in your
local repository will be shared across all of your Maven-built
projects.

To include jars within a jar, I don't see a way to convince the jar
plugin to do it:
   http://maven.apache.org/plugins/maven-jar-plugin/
but you can use the assembly plugin:
   http://maven.apache.org/plugins/maven-assembly-plugin/

--
Wendy

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






Re: Newbie question- 3rd party jars

Posted by Wendy Smoak <ws...@gmail.com>.
On 12/30/06, Sagare, Vipul <Vi...@tmobilebroadband.com> wrote:
> Both.
>
> I would like them to be in the classpath and in jar as well.

Normally you would install them in your local repository and then use
a <dependency> element in your pom.  If you're working with other
developers, you'll probably want to establish an internal/corporate
repository so that each developer doesn't have to install them
individually.

Then you won't need that "lib" directory at all, the jars in your
local repository will be shared across all of your Maven-built
projects.

To include jars within a jar, I don't see a way to convince the jar
plugin to do it:
   http://maven.apache.org/plugins/maven-jar-plugin/
but you can use the assembly plugin:
   http://maven.apache.org/plugins/maven-assembly-plugin/

-- 
Wendy

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


RE: Newbie question- 3rd party jars

Posted by "Sagare, Vipul" <Vi...@tmobilebroadband.com>.
Both.   
 
I would like them to be in the classpath and in jar as well.
 
Thanks,
Vipul

________________________________

From: Wendy Smoak [mailto:wsmoak@gmail.com]
Sent: Sat 12/30/2006 5:28 PM
To: Maven Users List
Subject: Re: Newbie question- 3rd party jars



On 12/30/06, Sagare, Vipul <Vi...@tmobilebroadband.com> wrote:

> After going through the book, I am trying to get one of our modules compile and package into jar. How do I include 3rd party Jars?   Here is my directory structure and pom.xml

I assume you mean "how do I include third party jars on the classpath
so I can compile my source code and package it in a jar?"  Correct?

>From your description, I can't tell whether you want the contents of
'lib' included in your jar.

--
Wendy

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






Re: Newbie question- 3rd party jars

Posted by Wendy Smoak <ws...@gmail.com>.
On 12/30/06, Sagare, Vipul <Vi...@tmobilebroadband.com> wrote:

> After going through the book, I am trying to get one of our modules compile and package into jar. How do I include 3rd party Jars?   Here is my directory structure and pom.xml

I assume you mean "how do I include third party jars on the classpath
so I can compile my source code and package it in a jar?"  Correct?

>From your description, I can't tell whether you want the contents of
'lib' included in your jar.

-- 
Wendy

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