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


##########
maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java:
##########
@@ -129,11 +129,11 @@ public void sessionStarted(ExecutionEvent event) {
 
             final List<MavenProject> projects = 
event.getSession().getProjects();
             for (MavenProject project : projects) {
-                int len = lineLength
-                        - project.getName().length()
-                        - project.getPackaging().length()
-                        - 2;
-                logger.info("{}{}[{}]", project.getName(), chars(' ', (len > 
0) ? len : 1), project.getPackaging());
+                String projectInfo = String.format(
+                        "%s:%s:%s [%s]",
+                        project.getGroupId(), project.getArtifactId(), 
project.getVersion(), project.getPackaging());
+                int len = lineLength - projectInfo.length();
+                logger.info("{}{}", projectInfo, chars(' ', (len > 0) ? len : 
1));

Review Comment:
   ⚠️ **Trailing padding is now invisible** — the original code computed `len` 
to right-align `[packaging]` at column `lineLength`, inserting spaces *between* 
the name and `[packaging]`. After this change, `projectInfo` already includes 
`[packaging]` at the end, so `chars(' ', len)` appends trailing spaces *after* 
the closing `]`. Those are invisible in a terminal — the alignment is silently 
broken.
   
   If alignment is desired, padding must be inserted *before* `[packaging]`, 
not after the whole string.



##########
maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java:
##########
@@ -129,11 +129,11 @@ public void sessionStarted(ExecutionEvent event) {
 
             final List<MavenProject> projects = 
event.getSession().getProjects();
             for (MavenProject project : projects) {
-                int len = lineLength
-                        - project.getName().length()
-                        - project.getPackaging().length()
-                        - 2;
-                logger.info("{}{}[{}]", project.getName(), chars(' ', (len > 
0) ? len : 1), project.getPackaging());
+                String projectInfo = String.format(
+                        "%s:%s:%s [%s]",
+                        project.getGroupId(), project.getArtifactId(), 
project.getVersion(), project.getPackaging());
+                int len = lineLength - projectInfo.length();
+                logger.info("{}{}", projectInfo, chars(' ', (len > 0) ? len : 
1));

Review Comment:
   ⚠️ **Wrong module** — this file lives in the deprecated `maven-embedder` 
compat shim. The active implementation (used by `mvn` in Maven 4) is:
   
   ```
   
impl/maven-cli/src/main/java/org/apache/maven/cling/event/ExecutionEventLogger.java
   ```
   
   Please retarget the PR to that file.



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