Return-Path: X-Original-To: apmail-maven-issues-archive@minotaur.apache.org Delivered-To: apmail-maven-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 74ECC18405 for ; Thu, 11 Feb 2016 08:34:18 +0000 (UTC) Received: (qmail 56722 invoked by uid 500); 11 Feb 2016 08:34:18 -0000 Delivered-To: apmail-maven-issues-archive@maven.apache.org Received: (qmail 56670 invoked by uid 500); 11 Feb 2016 08:34:18 -0000 Mailing-List: contact issues-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list issues@maven.apache.org Received: (qmail 56653 invoked by uid 99); 11 Feb 2016 08:34:18 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Feb 2016 08:34:18 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 212F62C1F58 for ; Thu, 11 Feb 2016 08:34:18 +0000 (UTC) Date: Thu, 11 Feb 2016 08:34:18 +0000 (UTC) From: "Hudson (JIRA)" To: issues@maven.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MNG-5935) Optional true getting lost in managed dependencies when transitive MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MNG-5935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15142419#comment-15142419 ] Hudson commented on MNG-5935: ----------------------------- SUCCESS: Integrated in maven-3.x #1216 (See [https://builds.apache.org/job/maven-3.x/1216/]) [MNG-5935] Optional true getting lost in managed dependencies when (schulte: rev 184f58ff83a6d043c695a07f1b1ae89630f6bc9e) * maven-aether-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorReaderDelegate.java * maven-core/src/main/java/org/apache/maven/RepositoryUtils.java > Optional true getting lost in managed dependencies when transitive > ------------------------------------------------------------------ > > Key: MNG-5935 > URL: https://issues.apache.org/jira/browse/MNG-5935 > Project: Maven > Issue Type: Bug > Components: Dependencies > Affects Versions: 3.3.9 > Environment: Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00) > Maven home: C:\Temp\apache-maven-3.3.9 > Java version: 1.8.0_66, vendor: Oracle Corporation > Java home: C:\Prog\Java\v8_66\jre > Default locale: nl_NL, platform encoding: Cp1252 > OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos" > Reporter: Marcel Schutte > Assignee: Christian Schulte > Fix For: 3.4.0 > > Attachments: Parent.zip, buildoutput.txt > > > Run 'mvn package' on the project in the attached Parent.zip. Note that the dependency Jar2 gets packaged in WEB-INF/lib and the other dependencies (Jar, Jar1 and Jar3) do not. > I think the inclusion of Jar2 is incorrect, because project 'Web' declares its dependency on 'Jar' to be optional and Jar2 being a transitive dependency of Jar should inherit this. > If you look at the other Jarx dependencies, they have different combinations of ways to become optional and have their versions managed. Only the case when optionality is inherited and the dependency management for the version is in another pom, yields incorrect results. > Please note that I believe the maven-war-plugin is not the cause of this behavior. I have built and used a modified version of maven-war-plugin which as the first thing in its WarMojo.execute() lists the result of getProject().getArtifacts() including the value of each Artifact's isOptional() method. Already at this point only Jar2 has optional false. > I am using maven-war-plugin in this bug report for the following reasons: > * maven-war-plugin uses the optional flag of dependencies in deciding whether to package it or not, making this behavior visible > * I don't know of another way to visualize the value of the optional flag in core maven (running with -X outputs the dependency tree in a section with header 'Dependency collection stats', but this only shows the scope value) > * maven-dependency-plugin:resolve also only shows scope and not optionality > * obviously, maven-war-plugin is exactly what I intend to use and where I found the bug -- This message was sent by Atlassian JIRA (v6.3.4#6332)