HarshMehta112 commented on issue #192:
URL: 
https://github.com/apache/maven-artifact-plugin/issues/192#issuecomment-3633596661

   I see your enhancement point: the `describe-build-output` goal should 
include build environment details (Java, OS, Maven), since 
`describeBuildOutput()` doesn’t show them.
   
   I experimented by adding a `describeBuildEnvironment()` helper in 
`DescribeBuildOutputMojo` and invoking it from `execute()`. The method looks 
like this:
   
   ```java
   private void describeBuildEnvironment() {
       getLog().info("Build environment:");
       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());
   }
   ```
   This produces output such as:
   
   ```
   [INFO] 
   [INFO] --- artifact:3.6.2-SNAPSHOT:describe-build-output (default-cli) @ 
multi ---
   [INFO] reactor executionRoot = 
org.apache.maven.plugins.it:multi:pom:1.0-SNAPSHOT (current)
          reactor first = org.apache.maven.plugins.it:parent:pom:1.0-SNAPSHOT @ 
parent\pom.xml
                  first.parent = org.apache.maven:maven-parent:pom:39
   [INFO] outputTimestamp = 1234567890 => 2009-02-13T23:31:30Z
   [INFO] plugin outputTimestamp parameter diagnostics:
           - plugin outputTimestamp parameter 
(defaultValue="${project.build.outputTimestamp}") = 1234567890
           - project.build.outputTimestamp property from project = 1234567890
           - project.build.outputTimestamp property from project model = 
1234567890
           - project.build.outputTimestamp property from project original model 
= null
   [INFO] Inheritance analysis for property:
           - current org.apache.maven.plugins.it:multi:pom:1.0-SNAPSHOT 
property = 1234567890
           - reactor parent org.apache.maven.plugins.it:parent:pom:1.0-SNAPSHOT 
property = 1234567890
           - external parent org.apache.maven:maven-parent:pom:39 property = 
2022-12-11T20:07:23Z
   [INFO] 
   [INFO] Build environment:
   [INFO]   java.version=21
   [INFO]   java.vendor=Oracle Corporation
   [INFO]   java.home=C:\Users\harsh.mehta\Harsh\JDK-21\jdk-21
   [INFO]   os.name=Windows 11
   [INFO]   os.version=10.0
   [INFO]   os.arch=amd64
   [INFO]   mvn.version=3.9.11
   [INFO] 
   [INFO] parent in reactor: org.apache.maven.plugins.it:parent @ 
parent\pom.xml (6 modules), property = 1234567890
   [INFO] 
   [INFO] groupId: org.apache.maven.plugins.it (5 artifactIds)
   [INFO] groupId: org.apache.maven.plugins.it.other.groupId (1 artifactId)
   [INFO] artifactId: multi-modA defined for multiple groupI
   ```
   
   @hboutemy Before I open a PR: is this the right place and approach for 
adding the build-environment details to the describe-build-output goal? If it 
looks correct, I’m happy to prepare a PR.


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