This is an automated email from the ASF dual-hosted git repository.

rmannibucau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/johnzon.git


The following commit(s) were added to refs/heads/master by this push:
     new f4fc305  JOHNZON-272 Fails to build Maven Plugin - Alternative Solution
f4fc305 is described below

commit f4fc305afe3c2c5e2a4f87464f7c3d47e45ddb89
Author: Markus KARG <mar...@headcrashing.eu>
AuthorDate: Tue Sep 24 22:47:23 2019 +0200

    JOHNZON-272 Fails to build Maven Plugin - Alternative Solution
    
    Using .gitattributes to guarantee LF line endings instead of explicitly
    replacing wrong line endings in Java code.
    
    Co-authored-by: Romain MANNI-BUCAU <rmannibu...@gmail.com>
    
    Signed-off-by: Markus KARG <mar...@headcrashing.eu>
---
 johnzon-maven-plugin/.gitattributes                      | 16 ++++++++++++++++
 .../johnzon/maven/plugin/ExampleToModelMojoTest.java     |  2 +-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/johnzon-maven-plugin/.gitattributes 
b/johnzon-maven-plugin/.gitattributes
new file mode 100644
index 0000000..feb3703
--- /dev/null
+++ b/johnzon-maven-plugin/.gitattributes
@@ -0,0 +1,16 @@
+#  Copyright (C) 2019 Markus KARG
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+src/test/resources/SomeValue.java text eol=lf
+
diff --git 
a/johnzon-maven-plugin/src/test/java/org/apache/johnzon/maven/plugin/ExampleToModelMojoTest.java
 
b/johnzon-maven-plugin/src/test/java/org/apache/johnzon/maven/plugin/ExampleToModelMojoTest.java
index 899b620..d0e89e1 100644
--- 
a/johnzon-maven-plugin/src/test/java/org/apache/johnzon/maven/plugin/ExampleToModelMojoTest.java
+++ 
b/johnzon-maven-plugin/src/test/java/org/apache/johnzon/maven/plugin/ExampleToModelMojoTest.java
@@ -111,7 +111,7 @@ public class ExampleToModelMojoTest {
         final File output = new File(targetFolder, 
"org/test/apache/johnzon/mojo/SomeValue.java");
         assertTrue(output.isFile());
         assertEquals(
-            new 
String(IOUtil.toByteArray(Thread.currentThread().getContextClassLoader().getResourceAsStream("SomeValue.java"))).replace("\r\n",
 "\n"),
+            new 
String(IOUtil.toByteArray(Thread.currentThread().getContextClassLoader().getResourceAsStream("SomeValue.java"))),
             new String(IOUtil.toByteArray(new 
FileReader(output))).replace(File.separatorChar, '/'));
     }
 }

Reply via email to