aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Schreier <martin_s@apache.org>2022-01-06 11:35:36 +0100
committerMartin Schreier <martin_s@apache.org>2022-01-06 11:35:36 +0100
commit512ff100d7404ab55f22042a625487dfa5913405 (patch)
treec2ec468711538c480917ad4ddae54d56964f234d
parent70bd7fdd3cf2021e6da6fd04424f1b877e612881 (diff)
downloadarchiva-512ff100d7404ab55f22042a625487dfa5913405.tar.gz
archiva-512ff100d7404ab55f22042a625487dfa5913405.zip
[MRM-2028] Fixing NPE on artifact removal
-rw-r--r--archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurge.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurge.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurge.java
index d16e911ee..a0e984a2c 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurge.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurge.java
@@ -254,13 +254,12 @@ public abstract class AbstractRepositoryPurge
if ( StringUtils.isNotBlank( reference.getClassifier( ) ) )
{
info.setClassifier( reference.getClassifier( ) );
- metaRemovalList.put( info, artifactMetadata );
}
else
{
- // metadataRepository.removeTimestampedArtifact( artifactMetadata, baseVersion );
- metaRemovalList.put( info, artifactMetadata );
+ info.setClassifier( "" );
}
+ metaRemovalList.put( info, artifactMetadata );
}
}
}
@@ -356,7 +355,7 @@ public abstract class AbstractRepositoryPurge
(MavenArtifactFacet) artifactMetadata.getFacet(
MavenArtifactFacet.FACET_ID );
- if ( StringUtils.equals( artifactInfo.classifier,
+ if ( mavenArtifactFacet != null && StringUtils.equals( artifactInfo.classifier,
mavenArtifactFacet.getClassifier( ) ) )
{
artifactMetadata.removeFacet( MavenArtifactFacet.FACET_ID );