Skip to content

Commit

Permalink
Fall back to default groupId when comparing plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Feb 27, 2024
1 parent d24949e commit 8a8d5ef
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

import java.util.List;
import java.util.Objects;
import java.util.Optional;

import static org.openrewrite.internal.StringUtils.matchesGlob;

Expand Down Expand Up @@ -176,7 +177,9 @@ && matchesGlob(d.getArtifactId(), exceptedArtifactId)) {
@Nullable
private static String getManagedPluginVersion(ResolvedPom resolvedPom, @Nullable String groupId, String artifactId) {
for (Plugin p : resolvedPom.getPluginManagement()) {
if (Objects.equals(p.getGroupId(), groupId) &&
if (Objects.equals(
Optional.ofNullable(p.getGroupId()).orElse("org.apache.maven.plugins"),
Optional.ofNullable(groupId).orElse("org.apache.maven.plugins")) &&
Objects.equals(p.getArtifactId(), artifactId)) {
return resolvedPom.getValue(p.getVersion());
}
Expand Down

0 comments on commit 8a8d5ef

Please sign in to comment.