Skip to content
Permalink
Browse files
Simplify.
  • Loading branch information
garydgregory committed Mar 12, 2022
1 parent 36b02c2 commit 1270c8e90eef88474726c65f908e3d69ce18a465
Showing 1 changed file with 3 additions and 5 deletions.
@@ -137,11 +137,9 @@ public void execute() throws MojoExecutionException {
// https://issues.apache.org/jira/browse/MNG-7316
try {
// (1) Try the normal way
for (final Artifact artifactToRemove : detachedArtifacts) {
// Maven 3.8.3 throws an exception here because MavenProject.getAttachedArtifacts()
// returns an IMMUTABLE collection.
project.getAttachedArtifacts().remove(artifactToRemove);
}
// Maven 3.8.3 throws an exception here because MavenProject.getAttachedArtifacts()
// returns an IMMUTABLE collection.
project.getAttachedArtifacts().removeAll(detachedArtifacts);
} catch (UnsupportedOperationException e) {
// (2) HACK workaround for https://issues.apache.org/jira/browse/MNG-7316
final ArrayList<Artifact> arrayList = new ArrayList<>(project.getAttachedArtifacts());

0 comments on commit 1270c8e

Please sign in to comment.