Skip to content

Commit 32566ad

Browse files
committed
fix: fix addParentPoms=true causes repositories to be ignored.
Signed-off-by: Keith Wall <kwall@apache.org>
1 parent 4308f6c commit 32566ad

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/main/java/org/apache/maven/plugins/dependency/fromDependencies/AbstractDependencyFilterMojo.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,9 +381,13 @@ private MavenProject buildProjectFromArtifact(Artifact artifact) throws MojoExec
381381
ProjectBuildingRequest buildingRequest =
382382
new DefaultProjectBuildingRequest(session.getProjectBuildingRequest());
383383
buildingRequest.setProcessPlugins(false);
384+
if (getProject().getRemoteArtifactRepositories() != null
385+
&& !getProject().getRemoteArtifactRepositories().isEmpty()) {
386+
buildingRequest.setRemoteRepositories(getProject().getRemoteArtifactRepositories());
387+
}
384388
return projectBuilder.build(artifact, buildingRequest).getProject();
385389
} catch (ProjectBuildingException e) {
386-
throw new MojoExecutionException("Coud not build project for " + artifact.getId(), e);
390+
throw new MojoExecutionException("Could not build project for " + artifact.getId(), e);
387391
}
388392
}
389393

0 commit comments

Comments
 (0)