cstamas commented on code in PR #2285:
URL: https://github.com/apache/maven/pull/2285#discussion_r2072468748


##########
impl/maven-core/src/main/java/org/apache/maven/DefaultMaven.java:
##########
@@ -408,7 +408,10 @@ private void persistResumptionData(MavenExecutionResult 
result, MavenSession ses
      */
     @Deprecated
     public RepositorySystemSession newRepositorySession(MavenExecutionRequest 
request) {
-        return newCloseableSession(request, new MavenChainedWorkspaceReader());
+        RepositorySystemSession result = newCloseableSession(request, new 
MavenChainedWorkspaceReader());
+        MavenSession session = new MavenSession(result, request, new 
DefaultMavenExecutionResult());
+        session.setSession(defaultSessionFactory.newSession(session));

Review Comment:
   Not just that: perso, _i'd make Maven warn in logs when this method is 
invoked_, just look at javadoc: "nobody should invoke this method". Takari 
Plugin testing does, but right now, there is no way to make Maven 3 codebase 
use ProjectBuilder with controlled session... or I am missing something.... Am 
on edge with this PR.
   
   @gnodet any opinion?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to