maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r797808 - /maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
Date Sat, 25 Jul 2009 18:03:13 GMT
Author: bentmann
Date: Sat Jul 25 18:03:13 2009
New Revision: 797808

URL: http://svn.apache.org/viewvc?rev=797808&view=rev
Log:
o Made model validation fail upon imported POM with classifier (which isn't supported)

Modified:
    maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java

Modified: maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java?rev=797808&r1=797807&r2=797808&view=diff
==============================================================================
--- maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
(original)
+++ maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
Sat Jul 25 18:03:13 2009
@@ -72,12 +72,12 @@
 
         if ( request.getValidationLevel() >= ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_2_0
)
         {
-            validateDependencies( result, model.getDependencies(), "dependencies", request
);
+            validateDependencies( result, model.getDependencies(), "dependencies.dependency",
request );
 
             if ( model.getDependencyManagement() != null )
             {
                 validateDependencies( result, model.getDependencyManagement().getDependencies(),
-                                      "dependencyManagment.dependencies", request );
+                                      "dependencyManagement.dependencies.dependency", request
);
             }
 
             validateRepositories( result, model.getRepositories(), "repositories.repository",
request );
@@ -87,13 +87,13 @@
             for ( Profile profile : model.getProfiles() )
             {
                 validateDependencies( result, profile.getDependencies(), "profiles.profile["
+ profile.getId()
-                    + "].dependencies", request );
+                    + "].dependencies.dependency", request );
 
                 if ( profile.getDependencyManagement() != null )
                 {
                     validateDependencies( result, profile.getDependencyManagement().getDependencies(),
-                                          "profiles.profile[" + profile.getId() + "].dependencyManagment.dependencies",
-                                          request );
+                                          "profiles.profile[" + profile.getId()
+                                              + "].dependencyManagement.dependencies.dependency",
request );
                 }
 
                 validateRepositories( result, profile.getRepositories(), "profiles.profile["
+ profile.getId()
@@ -278,6 +278,12 @@
         {
             String key = dependency.getManagementKey();
 
+            if ( "pom".equals( dependency.getType() ) && "import".equals( dependency.getScope()
)
+                && StringUtils.isNotEmpty( dependency.getClassifier() ) )
+            {
+                addViolation( result, false, "'" + prefix + ".classifier' must be empty for
imported POM: " + key );
+            }
+
             Dependency existing = index.get( key );
 
             if ( existing != null )



Mime
View raw message