]> source.dussan.org Git - archiva.git/commitdiff
[MRM-409] Updated validation of poms.
authorMaria Odea B. Ching <oching@apache.org>
Wed, 20 Jun 2007 10:21:47 +0000 (10:21 +0000)
committerMaria Odea B. Ching <oching@apache.org>
Wed, 20 Jun 2007 10:21:47 +0000 (10:21 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@549048 13f79535-47bb-0310-9956-ffa450edef68

archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/ProjectModelToDatabaseConsumer.java

index 78d678531d978574911b3b3025205e4db134881d..3104dc40a6fecd2a253b19f6c877911799a2d809 100644 (file)
@@ -176,7 +176,6 @@ public class ProjectModelToDatabaseConsumer
                 getLogger().warn( "Invalid or corrupt pom. Project model " + model + " was not added in the database." );
             }
 
-            dao.getProjectModelDAO().saveProjectModel( model );
         }
         catch ( ProjectModelException e )
         {
@@ -284,7 +283,7 @@ public class ProjectModelToDatabaseConsumer
             {
                 getLogger().warn(
                                   "Project Model " + model + " artifactId: " + model.getArtifactId()
-                                      + " does not match the pom file's artifactId: " + parts.artifactId );
+                                        + " does not match the pom file's artifactId: " + parts.artifactId );
 
                 addProblem( artifact, "Project Model " + model + " artifactId: " + model.getArtifactId()
                     + " does not match the pom file's artifactId: " + parts.artifactId );
@@ -295,8 +294,8 @@ public class ProjectModelToDatabaseConsumer
             if ( !parts.version.equalsIgnoreCase( model.getVersion() ) )
             {
                 getLogger().warn(
-                                  "Project Model " + model + " artifactId: " + model.getArtifactId()
-                                      + " does not match the pom file's artifactId: " + parts.artifactId );
+                                  "Project Model " + model + " version: " + model.getVersion()
+                                        + " does not match the pom file's version: " + parts.version );
 
                 addProblem( artifact, "Project Model " + model + " version: " + model.getVersion()
                     + " does not match the pom file's version: " + parts.version );
@@ -304,10 +303,20 @@ public class ProjectModelToDatabaseConsumer
                 return false;
             }
 
+            String constructedFilename;
+
+            if( parts.classifier != null )
+            {
+                constructedFilename = model.getArtifactId() + "-" + model.getVersion() + "-" +
+                    parts.classifier.trim() + ".pom";
+            }
+            else
+            {
+                constructedFilename = model.getArtifactId() + "-" + model.getVersion() + ".pom";
+            }                           
+
             //check if the file name matches the values indicated in the pom
-            if ( !artifactFile.getName().equalsIgnoreCase(
-                                                           model.getArtifactId() + "-" + model.getVersion() + "-"
-                                                               + parts.classifier ) )
+            if ( !artifactFile.getName().equalsIgnoreCase( constructedFilename ) )
             {
                 getLogger().warn(
                                   "Artifact " + artifact + " does not match the artifactId and/or version "