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 2020/11/01 19:56:39 UTC
[maven-artifact-plugin] branch master updated: check current line
separator against reference build value
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 9312eee check current line separator against reference build value
9312eee is described below
commit 9312eee7c24448b8ef2ffc2341796672803eb8c8
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Sun Nov 1 20:56:35 2020 +0100
check current line separator against reference build value
---
.../plugins/artifact/buildinfo/ReferenceBuildinfoUtil.java | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/main/java/org/apache/maven/plugins/artifact/buildinfo/ReferenceBuildinfoUtil.java b/src/main/java/org/apache/maven/plugins/artifact/buildinfo/ReferenceBuildinfoUtil.java
index cdc537b..25f301e 100644
--- a/src/main/java/org/apache/maven/plugins/artifact/buildinfo/ReferenceBuildinfoUtil.java
+++ b/src/main/java/org/apache/maven/plugins/artifact/buildinfo/ReferenceBuildinfoUtil.java
@@ -169,6 +169,20 @@ public class ReferenceBuildinfoUtil
{
p.println( "os.name=" + osName );
log.info( "Reference build os.name: " + osName );
+
+ // check against current line separator
+ String expectedLs = osName.startsWith( "Windows" ) ? "\r\n" : "\n";
+ if ( !expectedLs.equals( System.lineSeparator() ) )
+ {
+ log.warn( "Current System.lineSeparator() does not match reference build OS" );
+
+ String ls = System.getProperty( "line.separator" );
+ if ( !ls.equals( System.lineSeparator() ) )
+ {
+ log.warn( "System.lineSeparator() != System.getProperty( \"line.separator\" ): "
+ + "too late standard system property update..." );
+ }
+ }
}
}