[MNG-4005] Throw Validation Error if pom contains a dependency with two different versions

o Relaxed to warning for now to ease migration

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@928485 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2010-03-28 19:47:30 +00:00
parent fbaa48e658
commit b16a005106
2 changed files with 4 additions and 2 deletions

View File

@ -173,7 +173,7 @@ public class PomConstructionTest
}
/** MNG-4005 */
/** MNG-4005: postponed to 3.1
public void testValidationErrorUponNonUniqueDependencyKey()
throws Exception
{
@ -229,6 +229,7 @@ public class PomConstructionTest
// expected
}
}
*/
public void testDuplicateDependenciesCauseLastDeclarationToBePickedInLenientMode()
throws Exception

View File

@ -299,6 +299,7 @@ public class DefaultModelValidator
ModelBuildingRequest request )
{
Severity errOn30 = getSeverity( request, ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_3_0 );
Severity errOn31 = getSeverity( request, ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_3_1 );
Map<String, Dependency> index = new HashMap<String, Dependency>();
@ -340,7 +341,7 @@ public class DefaultModelValidator
+ StringUtils.defaultString( dependency.getVersion(), "(?)" );
}
addViolation( problems, errOn30, prefix + ".(groupId:artifactId:type:classifier)", null,
addViolation( problems, errOn31, prefix + ".(groupId:artifactId:type:classifier)", null,
"must be unique: " + key + " -> " + msg );
}
else