You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by DM <do...@yahoo.co.uk> on 2007/08/24 19:12:58 UTC
provided dependencies
Hi,
I have two maven modules, policy-core and policy-webapp. policy-webapp depends on policy-core, and they are packaged as a war and jar respectively. Both modules have the following dependency:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.3</version>
<scope>provided</scope>
</dependency>
When I package policy-webapp, I get both the following JARs in WEB-INF\lib
servlet-api-2.5-6.0.1.jar
servlet-api-2.3.jar
Obviously I don't want any servlet-api JARs in WEB-INF\lib becuase they should be provided by the container - this is why I set the scope to 'provided'.
Both policy-core and policy-webapp extend the same POM, but their parent POM doesn't mention servlet-api, so I don't think this is particularly relevant.
Any idea why these JARs are being copied to WEB-INF\lib and how I can prevent this?
Thanks in Advance,
DM
___________________________________________________________
Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
now.
http://uk.answers.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: provided dependencies
Posted by Tommy Knowlton <To...@KE4KUG.net>.
my guess would be that both modules depend transitively on the
javax.servlet in the runtime scope.
but, since guessing is not likely to be very helpful, may I recommend
the maven-dependency-plugin, which can give you a report that may
help you to locate the actual dependency chain that ends up bringing
those in. Then, you should decide whether to use <exclusions/>
elements in the <dependency/> declarations of those things that ended
up bringing it in.
Hope that helps,
\Tommy
On 24 Aug 2007, at 11:12 , DM wrote:
> Hi,
>
> I have two maven modules, policy-core and policy-webapp. policy-
> webapp depends on policy-core, and they are packaged as a war and
> jar respectively. Both modules have the following dependency:
>
> <dependency>
> <groupId>javax.servlet</groupId>
> <artifactId>servlet-api</artifactId>
> <version>2.3</version>
> <scope>provided</scope>
> </dependency>
>
> When I package policy-webapp, I get both the following JARs in WEB-
> INF\lib
>
> servlet-api-2.5-6.0.1.jar
> servlet-api-2.3.jar
>
> Obviously I don't want any servlet-api JARs in WEB-INF\lib becuase
> they should be provided by the container - this is why I set the
> scope to 'provided'.
> Both policy-core and policy-webapp extend the same POM, but their
> parent POM doesn't mention servlet-api, so I don't think this is
> particularly relevant.
>
> Any idea why these JARs are being copied to WEB-INF\lib and how I
> can prevent this?
>
> Thanks in Advance,
> DM
>
>
> ___________________________________________________________
> Yahoo! Answers - Got a question? Someone out there knows the
> answer. Try it
> now.
> http://uk.answers.yahoo.com/
>
> ---------------------------------------------------------------------
> 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