[MRM-77] avoid problems with metadata reporting

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@441780 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Porter 2006-09-09 11:27:23 +00:00
parent b340526e56
commit b37020b275
1 changed files with 17 additions and 7 deletions

View File

@ -263,6 +263,11 @@ public class BadMetadataReportProcessor
List metadataVersions = versioning != null ? versioning.getVersions() : Collections.EMPTY_LIST;
File versionsDir =
new File( repository.getBasedir(), repository.pathOfRemoteRepositoryMetadata( metadata ) ).getParentFile();
// TODO! I don't know how this condition can happen, but it was seen on the main repository.
// Avoid hard failure
if ( versionsDir.exists() )
{
List versions = FileUtils.getFileNames( versionsDir, "*/*.pom", null, false );
for ( Iterator i = versions.iterator(); i.hasNext(); )
{
@ -275,6 +280,11 @@ public class BadMetadataReportProcessor
}
}
}
else
{
reporter.addFailure( metadata, "Metadata's directory did not exist: " + versionsDir );
}
}
/**
* Used to gather artifactIds from a groupId directory.