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


##########
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:
   Also, my own code "maven 3 code cannot use project builder" proves am wrong: 
https://github.com/apache/maven-plugin-tools/blob/master/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginReport.java#L312-L329
   
   Still, Takari Plugin testing want to create session "from the scratch" for 
junit testing the Mojos, and _that_ is impossible right now. When you get a 
session (already associated with maven 4 session) all is fine.



-- 
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