mirror of https://github.com/apache/archiva.git
[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:
parent
0c58a1c253
commit
0c068d1f83
|
@ -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 "
|
||||
|
|
Loading…
Reference in New Issue