From 35e1fe03c0a9cea368dcc6a3e9b6c6e90f02cdb1 Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Sat, 25 Mar 2023 12:20:09 +0100 Subject: [PATCH] Fix #348 - Use repositories defined in project for artifact resolving --- src/main/java/org/codehaus/mojo/flatten/FlattenMojo.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/codehaus/mojo/flatten/FlattenMojo.java b/src/main/java/org/codehaus/mojo/flatten/FlattenMojo.java index f8b36c66..5d1f4f21 100644 --- a/src/main/java/org/codehaus/mojo/flatten/FlattenMojo.java +++ b/src/main/java/org/codehaus/mojo/flatten/FlattenMojo.java @@ -800,7 +800,7 @@ private ModelBuildingRequest createModelBuildingRequest(File pomFile) { repositorySystem, trace, context, - RepositoryUtils.toRepos(session.getProjectBuildingRequest().getRemoteRepositories()), + project.getRemoteProjectRepositories(), getReactorModelsFromSession()); Properties userProperties = this.session.getUserProperties(); List activeProfiles = this.session.getRequest().getActiveProfiles(); @@ -1028,7 +1028,7 @@ private void createFlattenedDependenciesAll( final Artifact projectArtifact = this.project.getArtifact(); CollectRequest collectRequest = new CollectRequest(); - collectRequest.setRepositories(project.getRemotePluginRepositories()); + collectRequest.setRepositories(project.getRemoteProjectRepositories()); collectRequest.setRootArtifact(RepositoryUtils.toArtifact(projectArtifact)); for (Dependency dependency : projectDependencies) { collectRequest.addDependency(RepositoryUtils.toDependency(