{
throw new ArchivaRestServiceException(
"You must configure a type/packaging when using classifier", 400, null );
}
// cleanup facet which contains classifier information
MavenArtifactFacet mavenArtifactFacet =
(MavenArtifactFacet) artifactMetadata.getFacet( MavenArtifactFacet.FACET_ID );
if ( StringUtils.equals( artifact.getClassifier(), mavenArtifactFacet.getClassifier() ) )
{
artifactMetadata.removeFacet( MavenArtifactFacet.FACET_ID );
String groupId = artifact.getGroupId(), artifactId = artifact.getArtifactId(), version =
artifact.getVersion();
//metadataRepository.updateArtifact( repositoryId, groupId, artifactId, version,
// artifactMetadata );
// String repositoryId, String namespace, String project, String version, String projectId, MetadataFacet metadataFacet
MavenArtifactFacet mavenArtifactFacetToCompare = new MavenArtifactFacet();
mavenArtifactFacetToCompare.setClassifier( artifact.getClassifier() );
metadataRepository.removeArtifact( repositoryId, groupId, artifactId, version,
mavenArtifactFacetToCompare );
metadataRepository.save();
}