maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Casey <>
Subject Re: How to use dependencyManagement?
Date Thu, 29 Sep 2005 14:19:36 GMT
Hash: SHA1

If you specify these two dependencies directly in your own dependency
set, and set their scope to provided, it should work.

FYI, DependencyManagement information is only triggered on demand. That
is, the info in the DependencyManagement section will be triggered if
you specify a dependency directly within your POM that matches the
groupId/artifactId of the info given in DependencyManagement. When this
happens, any specification in the original dependency will dominate over
the corresponding info in the DependencyManagement section.



Ralph Pöllath wrote:
| Hi,
| I get the following warning when packaging my webapp project:
|         Artifact javax.servlet:jsp-api:jar:2.0 has scope 'provided'
| replaced with 'compile'
|         as a dependency has given a broader scope. If this is not
| intended, use -X to locate the dependency,
|         or force the desired scope using dependencyManagement.
| Using -X tells me the dependency on javax.servlet:jsp-api-2.0 is
| introduced by springframework:spring-web-1.2.5, so I tried to exclude
| it like this:
| <dependency>
|     <groupId>springframework</groupId>
|     <artifactId>spring-web</artifactId>
|     <version>1.2.4</version>
|     <exclusions>
|         <exclusion>
|             <groupId>javax.servlet</groupId>
|             <artifactId>jsp-api</artifactId>
|         </exclusion>
|     </exclusions>
| </dependency>
| But unfortunately, jsp-api-2.0.jar still ends up in my war file,
| breaking my app.
| Now I'd like to "force the desired scope using dependencyManagement"  as
| mentioned in the warning, but cannot find any info on how to use  the
| dependencyManagement section in the pom.
| I'd like to use it to tell m2 to always set the scope of
| javax.servlet:jsp-api and javax.servlet:servlet-api to provided, and  to
| completely ignore some transitive dependencies like ojb and  toplink,
| which are introduced by springframework:spring-orm, for  example.
| Is that possible?
| Cheers,
| -Ralph.
| ---------------------------------------------------------------------
| To unsubscribe, e-mail:
| For additional commands, e-mail:
Version: GnuPG v1.2.6 (GNU/Linux)


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message