Skip to content

Commit

Permalink
Use all remote repositories for artifacts resolving
Browse files Browse the repository at this point in the history
we should use default remote repositories and repositories defined in project

Fix #225
  • Loading branch information
slawekjaranowski committed Jul 20, 2022
1 parent 2ee33d0 commit 9214cc7
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.regex.Pattern;

import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
import org.apache.maven.artifact.resolver.ArtifactResolutionRequest;
import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
Expand Down Expand Up @@ -142,10 +143,13 @@ private Set<Artifact> getAllDescendants( DependencyNode node )

private void resolveArtifact( Artifact artifact ) throws ArtifactResolutionException
{
Set<ArtifactRepository> remoteRepositories = new HashSet<>( session.getRequest().getRemoteRepositories() );
remoteRepositories.addAll( session.getRequest().getProjectBuildingRequest().getRemoteRepositories() );

ArtifactResolutionRequest request = new ArtifactResolutionRequest()
.setArtifact( artifact )
.setLocalRepository( session.getLocalRepository() )
.setRemoteRepositories( session.getRequest().getRemoteRepositories() )
.setRemoteRepositories( new ArrayList<>( remoteRepositories ) )
.setOffline( session.isOffline() )
.setForceUpdate( session.getRequest().isUpdateSnapshots() );

Expand Down

0 comments on commit 9214cc7

Please sign in to comment.