Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
3.0.3, 3.0.4
-
None
-
$ 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"$ 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"
Description
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:
<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>
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.