You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Jason van Zyl (JIRA)" <ji...@codehaus.org> on 2014/03/07 15:17:00 UTC

[jira] (MNG-5255) Dependency with 'provided' scope has its transitive dependency included in final artifact

    [ https://jira.codehaus.org/browse/MNG-5255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=342557#comment-342557 ] 

Jason van Zyl commented on MNG-5255:
------------------------------------

This appears to be a problem with the WAR plugin, if I setup a project using these dependencies and set them to provided and resolve with runtime scope the provided dependencies do not show up:

https://github.com/takari/maven-bugs/tree/master/project-mng5273

This is not a Maven core problem. If I were to make a new WAR plugin using the logic of the plugin defined in the POM of the bug project I would not see provided artifacts in the final WAR.

> 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
>            Assignee: Jason van Zyl
>         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 was sent by Atlassian JIRA
(v6.1.6#6162)