mirror of https://github.com/apache/archiva.git
[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:
parent
b340526e56
commit
b37020b275
|
@ -263,17 +263,27 @@ public class BadMetadataReportProcessor
|
||||||
List metadataVersions = versioning != null ? versioning.getVersions() : Collections.EMPTY_LIST;
|
List metadataVersions = versioning != null ? versioning.getVersions() : Collections.EMPTY_LIST;
|
||||||
File versionsDir =
|
File versionsDir =
|
||||||
new File( repository.getBasedir(), repository.pathOfRemoteRepositoryMetadata( metadata ) ).getParentFile();
|
new File( repository.getBasedir(), repository.pathOfRemoteRepositoryMetadata( metadata ) ).getParentFile();
|
||||||
List versions = FileUtils.getFileNames( versionsDir, "*/*.pom", null, false );
|
|
||||||
for ( Iterator i = versions.iterator(); i.hasNext(); )
|
// TODO! I don't know how this condition can happen, but it was seen on the main repository.
|
||||||
|
// Avoid hard failure
|
||||||
|
if ( versionsDir.exists() )
|
||||||
{
|
{
|
||||||
File path = new File( (String) i.next() );
|
List versions = FileUtils.getFileNames( versionsDir, "*/*.pom", null, false );
|
||||||
String version = path.getParentFile().getName();
|
for ( Iterator i = versions.iterator(); i.hasNext(); )
|
||||||
if ( !metadataVersions.contains( version ) )
|
|
||||||
{
|
{
|
||||||
reporter.addFailure( metadata, "Artifact version " + version + " found in the repository but " +
|
File path = new File( (String) i.next() );
|
||||||
"missing in the metadata." );
|
String version = path.getParentFile().getName();
|
||||||
|
if ( !metadataVersions.contains( version ) )
|
||||||
|
{
|
||||||
|
reporter.addFailure( metadata, "Artifact version " + version + " found in the repository but " +
|
||||||
|
"missing in the metadata." );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reporter.addFailure( metadata, "Metadata's directory did not exist: " + versionsDir );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue