From users-return-29778-apmail-maven-users-archive=maven.apache.org@maven.apache.org Thu Sep 29 16:37:18 2005 Return-Path: Delivered-To: apmail-maven-users-archive@www.apache.org Received: (qmail 89819 invoked from network); 29 Sep 2005 16:37:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 Sep 2005 16:37:18 -0000 Received: (qmail 52553 invoked by uid 500); 29 Sep 2005 16:37:11 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 52498 invoked by uid 500); 29 Sep 2005 16:37:10 -0000 Mailing-List: contact users-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Users List" Reply-To: "Maven Users List" Delivered-To: mailing list users@maven.apache.org Received: (qmail 52439 invoked by uid 99); 29 Sep 2005 16:37:09 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Sep 2005 09:37:09 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [212.227.126.183] (HELO moutng.kundenserver.de) (212.227.126.183) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Sep 2005 09:37:13 -0700 Received: from p5087C622.dip.t-dialin.net [80.135.198.34] (helo=[192.168.5.89]) by mrelayeu.kundenserver.de with ESMTP (Nemesis), id 0ML25U-1EL1Om1z3w-0005JS; Thu, 29 Sep 2005 18:36:44 +0200 Mime-Version: 1.0 (Apple Message framework v734) In-Reply-To: <433BF7F8.9060009@commonjava.org> References: <8B85FCB5-0DED-4894-BEC9-900B7FED081F@poellath.org> <433BF7F8.9060009@commonjava.org> Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: quoted-printable From: =?ISO-8859-1?Q?Ralph_P=F6llath?= Subject: Re: How to use dependencyManagement? Date: Thu, 29 Sep 2005 18:36:42 +0200 To: "Maven Users List" X-Mailer: Apple Mail (2.734) X-Provags-ID: kundenserver.de abuse@kundenserver.de login:d7f8e0e45bd0b219b9cff1d50a2c9ffe X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On 29.09.2005, at 16:19, John Casey wrote: > If you specify these two dependencies directly in your own dependency > set, and set their scope to provided, it should work. That's what I thought. Doesn't work for me though (I think it did =20 with previous versions): // pom.xml 4.0.0 test test war 0.1 javax.servlet servlet-api 2.4 provided springframework spring-web 1.2.4 javax.faces jsf-api // create web.xml to make maven happy $ mkdir -p src/main/webapp/WEB-INF $ touch src/main/webapp/WEB-INF/web.xml $ m2 package [INFO] =20 ------------------------------------------------------------------------=20= ---- [INFO] Building test:test:war:0.1 [INFO] task-segment: [package] [INFO] =20 ------------------------------------------------------------------------=20= ---- [INFO] [resources:resources] [WARNING] Artifact javax.servlet:servlet-api:jar:2.4 has scope =20 'provided' replaced with 'compile' as a dependency has given a broader scope. If this is not =20 intended, use -X to locate the dependency, or force the desired scope using dependencyManagement. ... [INFO] [war:war] [INFO] Copy webapp resources to test-0.1 [INFO] Assembling webapp test in test-0.1 [INFO] Generating war test-0.1.war [INFO] Building war: test-0.1.war [INFO] BUILD SUCCESSFUL // oops $ ls target/test-0.1/WEB-INF/lib | grep servlet servlet-api-2.4.jar > FYI, DependencyManagement information is only triggered on demand. =20 > 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 =20 > this > happens, any specification in the original dependency will dominate =20= > over > the corresponding info in the DependencyManagement section. This means I can use a parent pom to specify default dependency info =20 which can be overridden by child poms. Nice. Thanks, -Ralph. > Ralph P=F6llath wrote: > | Hi, > | > | I get the following warning when packaging my webapp project: > | > | [WARNING] > | 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 =20 > exclude > | it like this: > | > | > | springframework > | spring-web > | 1.2.4 > | > | > | javax.servlet > | jsp-api > | > | > | > | > | 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 =20 > dependencyManagement" as > | mentioned in the warning, but cannot find any info on how to use =20= > 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, =20 > and to > | completely ignore some transitive dependencies like ojb and =20 > toplink, > | which are introduced by springframework:spring-orm, for example. > | > | Is that possible? > | > | Cheers, > | -Ralph. > | > | > | > | > | =20 > --------------------------------------------------------------------- > | To unsubscribe, e-mail: users-unsubscribe@maven.apache.org > | For additional commands, e-mail: users-help@maven.apache.org > | > | > | > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.2.6 (GNU/Linux) > > iD8DBQFDO/f4K3h2CZwO/4URAhdxAJ9B0aNQT47F1Xz6sWXpqq5ix6c5SwCfTnwf > wtBsedkBkFQDCfc0OeBL6R0=3D > =3DHVC6 > -----END PGP SIGNATURE----- > > --------------------------------------------------------------------- > 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