You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2025/09/20 02:00:03 UTC
(maven-artifact-plugin) branch master updated: detail env in buildinfo, including line.separator
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-artifact-plugin.git
The following commit(s) were added to refs/heads/master by this push:
new 669dc6f detail env in buildinfo, including line.separator
669dc6f is described below
commit 669dc6fbfe1595cb1f2a89011b29a31f7637d4af
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Sat Sep 20 03:47:00 2025 +0200
detail env in buildinfo, including line.separator
fixes #174
---
.../apache/maven/plugins/artifact/buildinfo/BuildInfoWriter.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/maven/plugins/artifact/buildinfo/BuildInfoWriter.java b/src/main/java/org/apache/maven/plugins/artifact/buildinfo/BuildInfoWriter.java
index 6d92240..90c0436 100644
--- a/src/main/java/org/apache/maven/plugins/artifact/buildinfo/BuildInfoWriter.java
+++ b/src/main/java/org/apache/maven/plugins/artifact/buildinfo/BuildInfoWriter.java
@@ -85,13 +85,17 @@ class BuildInfoWriter {
if (reproducible) {
p.println("# build environment information (simplified for reproducibility)");
p.println("java.version=" + extractJavaMajorVersion(System.getProperty("java.version")));
- String ls = System.getProperty("line.separator");
+ String ls = System.lineSeparator();
p.println("os.name=" + ("\n".equals(ls) ? "Unix" : "Windows"));
} else {
p.println("# effective build environment information");
p.println("java.version=" + System.getProperty("java.version"));
p.println("java.vendor=" + System.getProperty("java.vendor"));
p.println("os.name=" + System.getProperty("os.name"));
+ p.println("os.version=" + System.getProperty("os.version"));
+ p.println("os.arch=" + System.getProperty("os.arch"));
+ p.println("line.separator="
+ + System.lineSeparator().replace("\r", "\\r").replace("\n", "\\n"));
}
p.println();
p.println("# Maven rebuild instructions and effective environment");