Skip to content

Commit

Permalink
[MPMD-384] maven-pmd-plugin is downloading transitive dependencies of…
Browse files Browse the repository at this point in the history
… unmanaged version

This closes #135
  • Loading branch information
caiwei-ebay authored and michael-o committed Aug 4, 2023
1 parent 3dcc10d commit 96e5079
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/org/apache/maven/plugins/pmd/PmdReport.java
Expand Up @@ -26,6 +26,7 @@
import java.util.Locale;

import net.sourceforge.pmd.renderers.Renderer;
import org.apache.maven.model.Dependency;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
Expand Down Expand Up @@ -503,8 +504,11 @@ private String determineAuxClasspath() throws MavenReportException {
// use any additional configured repo as well
buildingRequest.getRemoteRepositories().addAll(localProject.getRemoteArtifactRepositories());

List<Dependency> managedDependencies = localProject.getDependencyManagement() == null
? null
: localProject.getDependencyManagement().getDependencies();
Iterable<ArtifactResult> resolvedDependencies = dependencyResolver.resolveDependencies(
buildingRequest, localProject.getDependencies(), null, filter);
buildingRequest, localProject.getDependencies(), managedDependencies, filter);

for (ArtifactResult resolvedArtifact : resolvedDependencies) {
dependencies.add(
Expand Down

0 comments on commit 96e5079

Please sign in to comment.