[MRM-409] Updated validation of poms.

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@549048 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Maria Odea B. Ching 2007-06-20 10:21:47 +00:00
parent 0c58a1c253
commit 0c068d1f83
1 changed files with 16 additions and 7 deletions

View 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 )
{
@ -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 "