gnodet-bot commented on code in PR #14077:
URL: https://github.com/apache/maven/pull/14077#discussion_r4720118034


##########
impl/maven-impl/src/main/java/org/apache/maven/impl/build/DefaultBuildInvocation.java:
##########
@@ -86,22 +86,16 @@ public record DefaultBuildInvocation(
     /**
      * Creates a {@link BuildInvocation} snapshot from the current session 
state.
      *
-     * @param session the Maven session
+     * @param session the Maven session (new API)
      * @return a new immutable build invocation instance
      */
-    public static BuildInvocation from(MavenSession session) {
-        var request = session.getRequest();
-
-        List<String> goals = request.getGoals() != null ? 
List.copyOf(request.getGoals()) : List.of();
-
+    public static BuildInvocation from(Session session) {
+        // Build a minimal invocation from session properties

Review Comment:
   💡 **Nit:** The surrounding method Javadoc (`"Creates a {@link 
BuildInvocation} snapshot from the current session state"`) now overstates what 
this method returns. After removing the `session.buildInvocation()` delegation, 
only `userProperties`, `systemInfo`, and `threads` are populated; `goals`, 
`activeProfiles`, and all lifecycle fields default to empty/`FAIL_FAST`.
   
   Suggest updating the description to:
   ```suggestion
           // Build a minimal invocation from generic Session properties.
           // Note: goals, activeProfiles, selectedProjects, excludedProjects,
           // makeBehavior, resumeFrom, and reactorFailureBehavior are not 
extracted
           // by this fallback; only userProperties, systemInfo, and threads 
are populated.
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to