{
if ( StringUtils.isNotBlank( reference.getClassifier() ) )
{
// cleanup facet which contains classifier information
MavenArtifactFacet mavenArtifactFacet =
(MavenArtifactFacet) artifactMetadata.getFacet(
MavenArtifactFacet.FACET_ID );
if ( StringUtils.equals( reference.getClassifier(),
mavenArtifactFacet.getClassifier() ) )
{
artifactMetadata.removeFacet( MavenArtifactFacet.FACET_ID );
String groupId = reference.getGroupId(), artifactId =
reference.getArtifactId(),
version = reference.getVersion();
MavenArtifactFacet mavenArtifactFacetToCompare = new MavenArtifactFacet();
mavenArtifactFacetToCompare.setClassifier( reference.getClassifier() );
metadataRepository.removeArtifact( repository.getId(), groupId, artifactId,
version, mavenArtifactFacetToCompare );
metadataRepository.save();
}