[ https://jira.codehaus.org/browse/MNG-5255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=301537#comment-301537 ]
Rakesh commented on MNG-5255: ----------------------------- Ok here goes the details. We have this dependency as provided in the parent POM and the child pom just declares the groupid and artifactid. <dependency> <groupId>org.jboss.jbossas</groupId> <artifactId>jboss-as-tomcat</artifactId> <version>5.0.1.GA</version> <scope>provided</scope> </dependency> Ok now I ran the maven in the debug mode and put the output into the text file and here are the details. All of these below transitive dependencies of the above dependency we included are ending up in the final WAR WEB-INF/lib folder which should not be the case. There are lot of other jboss dependencies that are ending up as well. + WEB-INF/lib/jboss-security-spi-2.0.2.SP6.jar has been copied. [DEBUG] Processing: jboss-deployment-spi-5.0.3.GA.jar [DEBUG] + WEB-INF/lib/jboss-deployment-spi-5.0.3.GA.jar has been copied. [DEBUG] Processing: jbosssx-client-2.0.2.SP6.jar [DEBUG] + WEB-INF/lib/jbosssx-client-2.0.2.SP6.jar has been copied. [DEBUG] Processing: jbossws-native-jaxws-3.0.5.GA.jar [DEBUG] + WEB-INF/lib/jbossws-native-jaxws-3.0.5.GA.jar has been copied. [DEBUG] Processing: jbossws-native-saaj-3.0.5.GA.jar [DEBUG] + WEB-INF/lib/jbossws-native-saaj-3.0.5.GA.jar has been copied. + WEB-INF/lib/jboss-common-core-2.2.11.GA.jar has been copied. [DEBUG] Processing: jboss-metadata-1.0.0.CR16.jar [DEBUG] + WEB-INF/lib/jboss-metadata-1.0.0.CR16.jar has been copied. [DEBUG] Processing: jboss-ejb3-ext-api-1.0.0.jar [DEBUG] + WEB-INF/lib/jboss-ejb3-ext-api-1.0.0.jar has been copied. [DEBUG] Processing: jboss-jms-api-1.1.0.GA.jar [DEBUG] + WEB-INF/lib/jboss-jms-api-1.1.0.GA.jar has been copied. [DEBUG] Processing: jboss-transaction-api-1.0.1.GA.jar [DEBUG] + WEB-INF/lib/jboss-transaction-api-1.0.1.GA.jar has been copied. [DEBUG] Processing: jboss-jaxws-3.0.1-native-2.0.4.GA.jar [DEBUG] + WEB-INF/lib/jboss-jaxws-3.0.1-native-2.0.4.GA.jar has been copied. [DEBUG] Processing: jboss-mdr-2.0.0.GA.jar [DEBUG] + WEB-INF/lib/jboss-mdr-2.0.0.GA.jar has been copied. [DEBUG] Processing: jboss-kernel-2.0.4.GA.jar [DEBUG] + WEB-INF/lib/jboss-kernel-2.0.4.GA.jar has been copied. [DEBUG] Processing: jboss-jpa-deployers-1.0.0-Beta5.jar [DEBUG] + WEB-INF/lib/jboss-jpa-deployers-1.0.0-Beta5.jar has been copied. [DEBUG] Processing: jbosssx-2.0.2.SP2.jar [DEBUG] + WEB-INF/lib/jbosssx-2.0.2.SP2.jar has been copied. [DEBUG] Processing: jboss-jacc-api-1.1.0.GA_SP1.jar [DEBUG] + WEB-INF/lib/jboss-jacc-api-1.1.0.GA_SP1.jar has been copied. [DEBUG] Processing: servlet-api-2.1.1.GA.jar [DEBUG] + WEB-INF/lib/servlet-api-2.1.1.GA.jar has been copied. [DEBUG] Processing: jboss-jca-api-1.5.0.GA.jar [DEBUG] + WEB-INF/lib/jboss-jca-api-1.5.0.GA.jar has been copied. [DEBUG] Processing: jboss-ejb-api-3.0.0.GA.jar [DEBUG] + WEB-INF/lib/jboss-ejb-api-3.0.0.GA.jar has been copied. [DEBUG] Processing: ejb3-persistence-1.0.2.GA.jar [DEBUG] + WEB-INF/lib/ejb3-persistence-1.0.2.GA.jar has been copied. [DEBUG] Processing: jboss-classloading-spi-5.0.3.GA.jar [DEBUG] + WEB-INF/lib/jboss-classloading-spi-5.0.3.GA.jar has been copied. [DEBUG] Processing: jboss-as-j2se-5.0.1.GA.jar [DEBUG] + WEB-INF/lib/jboss-as-j2se-5.0.1.GA.jar has been copied. [DEBUG] Processing: jboss-as-security-5.0.1.GA.jar [DEBUG] + WEB-INF/lib/jboss-as-security-5.0.1.GA.jar has been copied. [DEBUG] Processing: jboss-as-deployment-5.0.1.GA.jar [DEBUG] + WEB-INF/lib/jboss-as-deployment-5.0.1.GA.jar has been copied. [DEBUG] Processing: jboss-jad-api-1.2.0.GA.jar [DEBUG] + WEB-INF/lib/jboss-jad-api-1.2.0.GA.jar has been copied. [DEBUG] Processing: jboss-as-bootstrap-5.0.1.GA.jar [DEBUG] + WEB-INF/lib/jboss-as-bootstrap-5.0.1.GA.jar has been copied. > Dependency with 'provided' scope has its transitive dependency included in > final artifact > ----------------------------------------------------------------------------------------- > > Key: MNG-5255 > URL: https://jira.codehaus.org/browse/MNG-5255 > Project: Maven 2 & 3 > Issue Type: Bug > Components: Dependencies > Affects Versions: 3.0.4 > Environment: Apache Maven 3.0.4 (r1232337; 2012-01-17 00:44:56-0800) > Maven home: D:\bin\apache-maven-3.0.4 > Java version: 1.6.0_27, vendor: Sun Microsystems Inc. > Java home: D:\bin\java\jdk1.6.0_27\jre > Default locale: en_US, platform encoding: Cp1252 > OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows" > Reporter: Bart Skondin > Attachments: provided-scope-not-working.zip > > > Expected: A dependency declared with a scope of 'provided', along with any > transitive dependencies, should not be included in the final artifact. > Actual: I have a dependency, jsp-api, declared with 'provided' scope. This > dependency has a dependency of its own, servlet-api. The servlet-api.jar is > being included in the web-inf/lib folder of the resultant war file. > Background: We recently upgraded from Maven 2.2.1 to Maven 3.0.4. The problem > was not witnessed until after the upgrade. > Steps to Reproduce: Run mvn install, then have a look at the web-inf/lib > folder. Notice that the servlet-api.jar has been included. > Additional Info: It seems that I can only reproduce this behavior when > declaring a specific dependency in my pom, spring-ldap. Here is the > dependency tree for the given pared-down project (attached): > --- maven-dependency-plugin:2.1:tree (default-cli) @ > provided-scope-not-working --- > com.bug.example:provided-scope-not-working:war:0.0.1-SNAPSHOT > +- javax.servlet:jsp-api:jar:2.0:provided > | \- javax.servlet:servlet-api:jar:2.4:provided > \- org.springframework.ldap:spring-ldap:jar:1.2.1:compile > +- commons-logging:commons-logging:jar:1.0.4:compile > +- commons-lang:commons-lang:jar:2.1:compile > +- org.springframework:spring-beans:jar:2.0.6:compile > | +- (commons-logging:commons-logging:jar:1.1:compile - omitted for > conflict with 1.0.4) > | \- (org.springframework:spring-core:jar:2.0.6:compile - omitted for > duplicate) > \- org.springframework:spring-core:jar:2.0.6:compile > \- (commons-logging:commons-logging:jar:1.1:compile - omitted for > conflict with 1.0.4) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira