You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "HarshMehta112 (via GitHub)" <gi...@apache.org> on 2025/12/12 09:15:31 UTC
[PR] [MAVEN-ARTIFACT #192] Add build environment description to `artifact:describe-build-output` [maven-artifact-plugin]
HarshMehta112 opened a new pull request, #197:
URL: https://github.com/apache/maven-artifact-plugin/pull/197
Fixes : #192
Following this checklist to help us incorporate your
contribution quickly and easily:
- [x] Your pull request should address just one issue, without pulling in other changes.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Each commit in the pull request should have a meaningful subject line and body.
Note that commits might be squashed by a maintainer on merge.
- [x] Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
This may not always be possible but is a best-practice.
- [x] Run `mvn verify` to make sure basic checks pass.
A more thorough check will be performed on your pull request automatically.
- [x] You have run the integration tests successfully (`mvn -Prun-its verify`).
If your pull request is about ~20 lines of code you don't need to sign an
[Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
you have to acknowledge this by using the following check-box.
- [x] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
- [x] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
----
This change enhances the `artifact:describe-build-output` goal by including a description of the build environment in its output.
```
[INFO] --- artifact:3.6.2-SNAPSHOT:describe-build-output (default-cli) @ maven-artifact-plugin ---
[INFO] outputTimestamp = 2025-09-29T16:18:23Z
[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
[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] line.separator=\r\n
[INFO]
[INFO] parent in reactor: org.apache.maven.plugins:maven-artifact-plugin @ pom.xml (1 module), property = 2025-09-29T16:18:23Z
[INFO]
[INFO] groupId: org.apache.maven.plugins (1 artifactId)
```
--
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-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [MAVEN-ARTIFACT #192] Add build environment description to `artifact:describe-build-output` [maven-artifact-plugin]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #197:
URL: https://github.com/apache/maven-artifact-plugin/pull/197#issuecomment-4574589040
@hboutemy Please assign appropriate label to PR according to the type of change.
--
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-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [MAVEN-ARTIFACT #192] Add build environment description to `artifact:describe-build-output` [maven-artifact-plugin]
Posted by "HarshMehta112 (via GitHub)" <gi...@apache.org>.
HarshMehta112 commented on code in PR #197:
URL: https://github.com/apache/maven-artifact-plugin/pull/197#discussion_r3316982370
##########
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:
@slawekjaranowski @hboutemy Sorry for late reply.
I updated the PR here are the resulted output :
<img width="839" height="265" alt="Screenshot 2026-05-28 at 3 34 59 PM" src="https://github.com/user-attachments/assets/a8a3a0b8-d20a-426f-a965-904cb9d94070" />
--
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-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [MAVEN-ARTIFACT #192] Add build environment description to `artifact:describe-build-output` [maven-artifact-plugin]
Posted by "slawekjaranowski (via GitHub)" <gi...@apache.org>.
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [MAVEN-ARTIFACT #192] Add build environment description to `artifact:describe-build-output` [maven-artifact-plugin]
Posted by "hboutemy (via GitHub)" <gi...@apache.org>.
hboutemy commented on code in PR #197:
URL: https://github.com/apache/maven-artifact-plugin/pull/197#discussion_r2986360999
##########
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:
@HarshMehta112 are you still tracking this PR?
this is an easy update, please
--
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-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [MAVEN-ARTIFACT #192] Add build environment description to `artifact:describe-build-output` [maven-artifact-plugin]
Posted by "hboutemy (via GitHub)" <gi...@apache.org>.
hboutemy merged PR #197:
URL: https://github.com/apache/maven-artifact-plugin/pull/197
--
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-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org