You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Tarje Killingberg (JIRA)" <ji...@codehaus.org> on 2012/12/20 13:13:13 UTC
[jira] (MNG-5415) Duplicate dependency with property causes the
build to fail
Tarje Killingberg created MNG-5415:
--------------------------------------
Summary: Duplicate dependency with property causes the build to fail
Key: MNG-5415
URL: https://jira.codehaus.org/browse/MNG-5415
Project: Maven 2 & 3
Issue Type: Bug
Components: Plugins and Lifecycle
Affects Versions: 3.0.4, 3.0.3
Environment: $ mvn -version
Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100)
Maven home: /usr/share/maven
Java version: 1.7.0_09, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.8.2", arch: "x86_64", family: "mac"
Reporter: Tarje Killingberg
Attachments: my-app.zip
The following excerpt from a _pom.xml_ file causes just about any maven command (e.g. {{mvn package}}) to fail with the error _'dependencies.dependency.version' for junit:junit:jar is missing_:
{code}
<properties>
<my.type>jar</my.type>
<my.other.type>jar</my.other.type>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<type>${my.type}</type>
</dependency>
<dependency>
<artifactId>junit</artifactId>
<groupId>junit</groupId>
<version>4.10</version>
<type>${my.other.type}</type>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<artifactId>junit</artifactId>
<groupId>junit</groupId>
<type>${my.type}</type>
</dependency>
<dependency>
<artifactId>junit</artifactId>
<groupId>junit</groupId>
<type>${my.other.type}</type>
<optional>true</optional>
</dependency>
</dependencies>
{code}
If the string _jar_ is used instead of the properties, the build succeeds with warnings.
A SSCCE is attached. Running the command {{mvn validate}} inside the _my-app_-folder should show the symptom.
--
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