Skip to content
Permalink
Browse files
Use final.
  • Loading branch information
garydgregory committed Mar 12, 2022
1 parent 1270c8e commit 80375b75133ee8f12c65cbf9e2963e5e6ed60cd0
Showing 1 changed file with 2 additions and 2 deletions.
@@ -140,14 +140,14 @@ public void execute() throws MojoExecutionException {
// Maven 3.8.3 throws an exception here because MavenProject.getAttachedArtifacts()
// returns an IMMUTABLE collection.
project.getAttachedArtifacts().removeAll(detachedArtifacts);
} catch (UnsupportedOperationException e) {
} catch (final UnsupportedOperationException e) {
// (2) HACK workaround for https://issues.apache.org/jira/browse/MNG-7316
final ArrayList<Artifact> arrayList = new ArrayList<>(project.getAttachedArtifacts());
arrayList.removeAll(detachedArtifacts);
try {
// MavenProject#setAttachedArtifacts(List) is protected
MethodUtils.invokeMethod(project, true, "setAttachedArtifacts", arrayList);
} catch (ReflectiveOperationException roe) {
} catch (final ReflectiveOperationException roe) {
throw new MojoExecutionException(roe);
}
}

0 comments on commit 80375b7

Please sign in to comment.