Skip to content

Commit

Permalink
[MNG-7994] Update to Resolver 2.0.0-alpha-6 (apache#1373)
Browse files Browse the repository at this point in the history
Update to alpha-6. Also, move off from deprecated default ctor of def repo session in tests.

---

https://issues.apache.org/jira/browse/MNG-7994
  • Loading branch information
cstamas committed Jan 11, 2024
1 parent cfa13f5 commit c4ccba7
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 369,7 @@ public static RepositorySystemSession overlay(
}
newSession = new DefaultRepositorySystemSession(session);
} else {
newSession = new DefaultRepositorySystemSession();
newSession = new DefaultRepositorySystemSession(h -> false); // no close handle used
}

final LocalRepositoryManager llrm =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 65,10 @@ public void execute(MavenSession session, List<MojoExecution> mojoExecutions, Pr
mavenExecutionRequest.setExecutionListener(new AbstractExecutionListener());
mavenExecutionRequest.setGoals(Arrays.asList("clean"));
final MavenSession session = new MavenSession(
null, new DefaultRepositorySystemSession(), mavenExecutionRequest, defaultMavenExecutionResult);
null,
new DefaultRepositorySystemSession(h -> false),
mavenExecutionRequest,
defaultMavenExecutionResult);
final ProjectDependencyGraphStub dependencyGraphStub = new ProjectDependencyGraphStub();
session.setProjectDependencyGraph(dependencyGraphStub);
session.setProjects(dependencyGraphStub.getSortedProjects());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 312,8 @@ private static MavenSession createSession(PlexusContainer container, ArtifactRep
.setBaseDirectory(new File(""))
.setLocalRepository(repo);

DefaultRepositorySystemSession repositorySession = new DefaultRepositorySystemSession();
DefaultRepositorySystemSession repositorySession =
new DefaultRepositorySystemSession(h -> false); // no close handle
repositorySession.setLocalRepositoryManager(new SimpleLocalRepositoryManagerFactory()
.newInstance(repositorySession, new LocalRepository(repo.getUrl())));
MavenSession session =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 72,7 @@ public void print(Object o) {
TransferResource resource = new TransferResource(null, null, "http://maven.org/test/test-resource", null, null);
resource.setContentLength(size - 1);

DefaultRepositorySystemSession session = new DefaultRepositorySystemSession();
DefaultRepositorySystemSession session = new DefaultRepositorySystemSession(h -> false); // no close handle

// warm up
test(listener, session, resource, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 63,7 @@ private MavenRepositorySystemUtils() {
*/
@Deprecated
public static DefaultRepositorySystemSession newSession() {
DefaultRepositorySystemSession session = new DefaultRepositorySystemSession();
DefaultRepositorySystemSession session = new DefaultRepositorySystemSession(h -> false); // no close handle

DependencyTraverser depTraverser = new FatArtifactTraverser();
session.setDependencyTraverser(depTraverser);
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 176,7 @@ under the License.
<plexusInterpolationVersion>1.26</plexusInterpolationVersion>
<plexusTestingVersion>1.0.0</plexusTestingVersion>
<plexusXmlVersion>4.0.1</plexusXmlVersion>
<resolverVersion>2.0.0-alpha-5</resolverVersion>
<resolverVersion>2.0.0-alpha-6</resolverVersion>
<securityDispatcherVersion>2.0</securityDispatcherVersion>
<sisuVersion>0.9.0.M2</sisuVersion>
<slf4jVersion>2.0.11</slf4jVersion>
Expand Down

0 comments on commit c4ccba7

Please sign in to comment.