Metadata metadata;
if ( RELEASE.equals( version ) )
{
metadata =
new DefaultMetadata( artifact.getGroupId(), artifact.getArtifactId(), MAVEN_METADATA_XML,
Metadata.Nature.RELEASE );
}
else if ( LATEST.equals( version ) )
{
metadata =
new DefaultMetadata( artifact.getGroupId(), artifact.getArtifactId(), MAVEN_METADATA_XML,
Metadata.Nature.RELEASE_OR_SNAPSHOT );
}
else if ( version.endsWith( SNAPSHOT ) )
{
WorkspaceReader workspace = session.getWorkspaceReader();
if ( workspace != null && workspace.findVersions( artifact ).contains( version ) )
{
metadata = null;
result.setRepository( workspace.getRepository() );
}
else
{
metadata =
new DefaultMetadata( artifact.getGroupId(), artifact.getArtifactId(), version, MAVEN_METADATA_XML,
Metadata.Nature.SNAPSHOT );
}
}
else
{