You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Comerford, Sean" <Se...@espn3.com> on 2009/08/10 17:01:36 UTC

maven-war-plugin - single jar in /WEB-INB/lib?

I have a Maven 2.0.9 webapp build that uses the WAR plugin.

My pom lists just a single dependency foo version 2.0.

But when the plugin builds my WAR, the WEB-INF/lib directory contains all of
the different jars that constitute the foo dependency.

Is there a way to have JUST foo-2.0.jar show in WEB-INF/lib instead of all
the other jars?

-- 
Sean Comerford, Software Engineer
ESPN.com Site Architecture Group
Office: 860.766.6454    Cell: 860.951.6973


Re: maven-war-plugin - single jar in /WEB-INB/lib?

Posted by "Comerford, Sean" <Se...@espn3.com>.
I’m with you as far as it being silly but my marching orders are to use the
single jar dependency build.

So thanks for the tip!

On 8/10/09 9:41 PM, "Wayne Fay" <wa...@gmail.com> wrote:

>> > We¹re currently using the shade plugin to generate a single, uber foo.jar
>> > containing all of foo¹s classses as well as the class files of ALL
>> > dependencies.
> 
> Assuming you've installed the foo-2.0-with-dependencies.jar file to
> your repo, you should be able to depend on:
> groupId: ??
> artifactId: foo
> version: 2.0
> classifier: with-dependencies
> 
> But this whole discussion is silly IMO. Stop fighting Maven, and
> follow the convention...
> 
> Wayne
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 

-- 
Sean Comerford, Software Engineer
ESPN.com Site Architecture Group
Office: 860.766.6454    Cell: 860.951.6973


Re: maven-war-plugin - single jar in /WEB-INB/lib?

Posted by Wayne Fay <wa...@gmail.com>.
> We¹re currently using the shade plugin to generate a single, uber foo.jar
> containing all of foo¹s classses as well as the class files of ALL
> dependencies.

Assuming you've installed the foo-2.0-with-dependencies.jar file to
your repo, you should be able to depend on:
groupId: ??
artifactId: foo
version: 2.0
classifier: with-dependencies

But this whole discussion is silly IMO. Stop fighting Maven, and
follow the convention...

Wayne

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


Re: maven-war-plugin - single jar in /WEB-INB/lib?

Posted by "Comerford, Sean" <Se...@espn3.com>.
Let me try to clarify again:

We¹re currently using the shade plugin to generate a single, uber foo.jar
containing all of foo¹s classses as well as the class files of ALL
dependencies.

I want to apply that same idea to my my Maven war build as far as the stuff
going into /WEB-INF/lib

That is, instead of having 10 different jars (foo.jar and all of its
dependency jars) in my WAR¹s WEB-INF/lib folder, I just want it to contain
the uber foo-with-dependencies.jar artifact.

Maven¹s war plugin seems to automatically expand all dependencies and suck
in the individual jars instead.

Unless I¹m missing something, provided scope is just something that tells
Maven to exclude a dependency from the output.

I¹m actually using that (for example) on the servlet-api dependency b/c app
servers don¹t let you deploy your own copy of javax.servlet.

On 8/10/09 12:25 PM, "Mick Knutson" <mi...@gmail.com> wrote:

> <scope>provided</scope>
> 
> 
> 
> 
> ---
> Thank YouŠ
> 
> Mick Knutson, President
> 
> BASE Logic, Inc.
> Enterprise Architecture, Design, Mentoring & Agile Consulting
> p. (866) BLiNC-411: (254-6241-1)
> f. (415) 685-4233
> 
> Website: http://baselogic.com
> Linked IN: http://linkedin.com/in/mickknutson
> Vacation Rental: http://tahoe.baselogic.com
> ---
> 
> 
> 
> On Mon, Aug 10, 2009 at 12:18 PM, Heinrich Nirschl <
> heinrich.nirschl@gmail.com> wrote:
> 
>> > On Mon, Aug 10, 2009 at 5:01 PM, Comerford,
>> > Sean<Se...@espn3.com> wrote:
>>> > > I have a Maven 2.0.9 webapp build that uses the WAR plugin.
>>> > >
>>> > > Is there a way to have JUST foo-2.0.jar show in WEB-INF/lib instead of
>> > all
>>> > > the other jars?
>> >
>> > Yes, have a look at the packagingExclude and packagingInclude parameters in
>> > http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html
>> >
>> > But I do not understand why you would like to have this.
>> >
>> > - Henry
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> > For additional commands, e-mail: users-help@maven.apache.org
>> >
>> >
> 

-- 
Sean Comerford, Software Engineer
ESPN.com Site Architecture Group
Office: 860.766.6454    Cell: 860.951.6973


Re: maven-war-plugin - single jar in /WEB-INB/lib?

Posted by Mick Knutson <mi...@gmail.com>.
<scope>provided</scope>




---
Thank You…

Mick Knutson, President

BASE Logic, Inc.
Enterprise Architecture, Design, Mentoring & Agile Consulting
p. (866) BLiNC-411: (254-6241-1)
f. (415) 685-4233

Website: http://baselogic.com
Linked IN: http://linkedin.com/in/mickknutson
Vacation Rental: http://tahoe.baselogic.com
---



On Mon, Aug 10, 2009 at 12:18 PM, Heinrich Nirschl <
heinrich.nirschl@gmail.com> wrote:

> On Mon, Aug 10, 2009 at 5:01 PM, Comerford,
> Sean<Se...@espn3.com> wrote:
> > I have a Maven 2.0.9 webapp build that uses the WAR plugin.
> >
> > Is there a way to have JUST foo-2.0.jar show in WEB-INF/lib instead of
> all
> > the other jars?
>
> Yes, have a look at the packagingExclude and packagingInclude parameters in
> http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html
>
> But I do not understand why you would like to have this.
>
> - Henry
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: maven-war-plugin - single jar in /WEB-INB/lib?

Posted by "Agrawal, Sandeep (IS Consultant)" <SA...@consultantemail.com>.
It should work for you as we also faced the same issue and it worked fine with me if I am getting your question properly:

<dependencies>
		<dependency>
				<groupId>com.wellmanage.trading.gts</groupId>
				<artifactId>jnlp-servlet</artifactId>
				<version>Version</version>
				<scope>runtime</scope>
				<exclusions>
					<exclusion>
						<groupId>weblogic</groupId>
						<artifactId>weblogic</artifactId>
					</exclusion>
				</exclusions>
		</dependency>
	</dependencies> 


Thanks
Sandeep

-----Original Message-----
From: Comerford, Sean [mailto:Sean.Comerford@espn3.com] 
Sent: Monday, August 10, 2009 12:23 PM
To: Maven Users List
Subject: Re: maven-war-plugin - single jar in /WEB-INB/lib?

Sorry. I¹m didn¹t ask the question properly. Let me re-phrase:

Artifact foo has a shade plugin based build that generates a single ³with-dependencies² jar containing all classes and dependent classes.

I want that single jar (foo-2.0-with-dependencies.jar) to be placed in my WAR artifact¹s WEB-INF/lib folder.

Is that possible (other than doing something manual like unpack)?

Thanks,
Sean

On 8/10/09 12:18 PM, "Heinrich Nirschl" <he...@gmail.com> wrote:

> On Mon, Aug 10, 2009 at 5:01 PM, Comerford, 
> Sean<Se...@espn3.com> wrote:
>> > I have a Maven 2.0.9 webapp build that uses the WAR plugin.
>> >
>> > Is there a way to have JUST foo-2.0.jar show in WEB-INF/lib instead 
>> > of all the other jars?
> 
> Yes, have a look at the packagingExclude and packagingInclude 
> parameters in 
> http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html
> 
> But I do not understand why you would like to have this.
> 
> - Henry
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 

--
Sean Comerford, Software Engineer
ESPN.com Site Architecture Group
Office: 860.766.6454    Cell: 860.951.6973


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


Re: maven-war-plugin - single jar in /WEB-INB/lib?

Posted by "Comerford, Sean" <Se...@espn3.com>.
Sorry. I¹m didn¹t ask the question properly. Let me re-phrase:

Artifact foo has a shade plugin based build that generates a single
³with-dependencies² jar containing all classes and dependent classes.

I want that single jar (foo-2.0-with-dependencies.jar) to be placed in my
WAR artifact¹s WEB-INF/lib folder.

Is that possible (other than doing something manual like unpack)?

Thanks,
Sean

On 8/10/09 12:18 PM, "Heinrich Nirschl" <he...@gmail.com> wrote:

> On Mon, Aug 10, 2009 at 5:01 PM, Comerford,
> Sean<Se...@espn3.com> wrote:
>> > I have a Maven 2.0.9 webapp build that uses the WAR plugin.
>> >
>> > Is there a way to have JUST foo-2.0.jar show in WEB-INF/lib instead of all
>> > the other jars?
> 
> Yes, have a look at the packagingExclude and packagingInclude parameters in
> http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html
> 
> But I do not understand why you would like to have this.
> 
> - Henry
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 

-- 
Sean Comerford, Software Engineer
ESPN.com Site Architecture Group
Office: 860.766.6454    Cell: 860.951.6973


Re: maven-war-plugin - single jar in /WEB-INB/lib?

Posted by Heinrich Nirschl <he...@gmail.com>.
On Mon, Aug 10, 2009 at 5:01 PM, Comerford,
Sean<Se...@espn3.com> wrote:
> I have a Maven 2.0.9 webapp build that uses the WAR plugin.
>
> Is there a way to have JUST foo-2.0.jar show in WEB-INF/lib instead of all
> the other jars?

Yes, have a look at the packagingExclude and packagingInclude parameters in
http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html

But I do not understand why you would like to have this.

- Henry

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