slawekjaranowski commented on code in PR #197:
URL: 
https://github.com/apache/maven-artifact-plugin/pull/197#discussion_r2969434314


##########
src/main/java/org/apache/maven/plugins/artifact/buildinfo/DescribeBuildOutputMojo.java:
##########
@@ -74,12 +74,27 @@ public void execute() throws MojoExecutionException {
 
         diagnose(outputTimestamp, getLog(), project, session, effective);
         getLog().info("");
+        describeBuildEnvironment();
+        getLog().info("");
         describeBuildOutput();
     }
 
     private Path rootPath;
     private BuildInfoWriter bi;
 
+    private void describeBuildEnvironment() {
+        getLog().info("Build environment information");
+        getLog().info("  java.version=" + System.getProperty("java.version"));
+        getLog().info("  java.vendor=" + System.getProperty("java.vendor"));
+        getLog().info("  java.home=" + System.getProperty("java.home"));
+        getLog().info("  os.name=" + System.getProperty("os.name"));
+        getLog().info("  os.version=" + System.getProperty("os.version"));
+        getLog().info("  os.arch=" + System.getProperty("os.arch"));
+        getLog().info("  mvn.version=" + rtInformation.getMavenVersion());

Review Comment:
   Instead of new info method call for each line we can concat message be new 
system line with dash and call info method once.
   
   output will be more consistent with we have ....
   
   can look like:
   
   ```
   [INFO] plugin outputTimestamp parameter diagnostics:
           - plugin outputTimestamp parameter 
(defaultValue="${project.build.outputTimestamp}") = 2025-09-29T16:18:23Z
           - project.build.outputTimestamp property from project = 
2025-09-29T16:18:23Z
           - project.build.outputTimestamp property from project model = 
2025-09-29T16:18:23Z
           - project.build.outputTimestamp property from project original model 
= 2025-09-29T16:18:23Z
   [INFO] Inheritance analysis for property:
           - current 
org.apache.maven.plugins:maven-artifact-plugin:maven-plugin:3.6.2-SNAPSHOT 
property = 2025-09-29T16:18:23Z
           - external parent org.apache.maven.plugins:maven-plugins:pom:45 
property = 2025-06-14T08:21:05Z
   [INFO] 
   [INFO] Build environment information
           - java.version=21
           - java.vendor=Oracle Corporation
           - java.home=C:\Users\harsh.mehta\Harsh\JDK-21\jdk-21
           - os.name=Windows 11
        ...
   ```



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