Skip to content

Commit

Permalink
Use only repos configured in project
Browse files Browse the repository at this point in the history
to avoid leaking requests to remote repositories
that are not configured for the project
  • Loading branch information
Volodjam authored and cpfeiffer committed Dec 20, 2024
1 parent bf4a3d2 commit e36e525
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package org.apache.maven.report.projectinfo.dependencies.renderer;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
Expand All @@ -28,6 +29,7 @@
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.versioning.ArtifactVersion;
import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
import org.apache.maven.artifact.versioning.VersionRange;
Expand Down Expand Up @@ -194,7 +196,13 @@ private void renderDependenciesForScope(String scope, List<Dependency> artifacts
String[] tableHeader = getDependencyTableHeader(hasClassifier);
tableHeader(tableHeader);

List<ArtifactRepository> remoteRpositories = new ArrayList<>(buildingRequest.getRemoteRepositories());
List<ArtifactRepository> pluginRpositories = new ArrayList<>(
buildingRequest.getPluginArtifactRepositories());

for (Dependency dependency : artifacts) {
buildingRequest.setRemoteRepositories(remoteRpositories);
buildingRequest.setPluginArtifactRepositories(pluginRpositories);
tableRow(getDependencyRow(dependency, hasClassifier));
}
endTable();
Expand Down

0 comments on commit e36e525

Please sign in to comment.