{
// Nothing to do here, file doesn't exist, skip it.
return;
}
ArtifactReference artifact = repository.toArtifactReference( path );
if ( !VersionUtil.isSnapshot( artifact.getVersion() ) )
{
// Nothing to do here, not a snapshot, skip it.
return;
}
ProjectReference reference = new ProjectReference();
reference.setGroupId( artifact.getGroupId() );
reference.setArtifactId( artifact.getArtifactId() );
// Gather up all of the versions.
List<String> allVersions = new ArrayList<String>( repository.getVersions( reference ) );
// Split the versions into released and snapshots.
List<String> releasedVersions = new ArrayList<String>();
List<String> snapshotVersions = new ArrayList<String>();
for ( String version : allVersions )
{
if ( VersionUtil.isSnapshot( version ) )
{
snapshotVersions.add( version );
}
else
{
releasedVersions.add( version );
}
}
Collections.sort( allVersions, VersionComparator.getInstance() );
Collections.sort( releasedVersions, VersionComparator.getInstance() );
Collections.sort( snapshotVersions, VersionComparator.getInstance() );
VersionedReference versionRef = new VersionedReference();
versionRef.setGroupId( artifact.getGroupId() );
versionRef.setArtifactId( artifact.getArtifactId() );
for ( String version : snapshotVersions )
{
if ( releasedVersions.contains( VersionUtil.getReleaseVersion( version ) ) )
{