diff --git a/src/it/projects/describe-cmd-with-goal/verify.groovy b/src/it/projects/describe-cmd-with-goal/verify.groovy index e413316e..4e2dc2b2 100644 --- a/src/it/projects/describe-cmd-with-goal/verify.groovy +++ b/src/it/projects/describe-cmd-with-goal/verify.groovy @@ -19,7 +19,7 @@ def result = new File(basedir, 'result.txt').text; -def ls = System.getProperty( "line.separator" ); +def ls = System.lineSeparator(); assert result.contains("'deploy:deploy' is a plugin goal (aka mojo)." + ls + "Mojo: 'deploy:deploy'" + ls + diff --git a/src/it/projects/describe-cmd/verify.groovy b/src/it/projects/describe-cmd/verify.groovy index 90f540fd..abc89219 100644 --- a/src/it/projects/describe-cmd/verify.groovy +++ b/src/it/projects/describe-cmd/verify.groovy @@ -19,7 +19,7 @@ def result = new File(basedir, 'result-deploy.txt').text; -def ls = System.getProperty( "line.separator" ); +def ls = System.lineSeparator(); assert result.contains("'deploy' is a phase corresponding to this plugin:" + ls + "org.apache.maven.plugins:maven-deploy-plugin") diff --git a/src/it/projects/describe-plugin-in-plugin-management/verify.groovy b/src/it/projects/describe-plugin-in-plugin-management/verify.groovy index 4cf535fe..e15e0023 100644 --- a/src/it/projects/describe-plugin-in-plugin-management/verify.groovy +++ b/src/it/projects/describe-plugin-in-plugin-management/verify.groovy @@ -18,7 +18,7 @@ */ def result = new File(basedir, 'result.txt').text; -def ls = System.getProperty( "line.separator" ); +def ls = System.lineSeparator(); assert result.contains( "Group Id: org.apache.maven.plugins" + ls + diff --git a/src/it/projects/describe-plugin-without-name/verify.groovy b/src/it/projects/describe-plugin-without-name/verify.groovy index c90d2c66..a6b928a2 100644 --- a/src/it/projects/describe-plugin-without-name/verify.groovy +++ b/src/it/projects/describe-plugin-without-name/verify.groovy @@ -19,7 +19,7 @@ def result = new File(basedir, 'result.txt').text; -def ls = System.getProperty( "line.separator" ); +def ls = System.lineSeparator(); assert result.contains( "Name: Maven Help Plugin" ) diff --git a/src/it/projects/effective-pom-artifact/verify.groovy b/src/it/projects/effective-pom-artifact/verify.groovy index ebb76e39..56ce53ed 100644 --- a/src/it/projects/effective-pom-artifact/verify.groovy +++ b/src/it/projects/effective-pom-artifact/verify.groovy @@ -19,7 +19,7 @@ def result = new File(basedir, 'result.txt'); assert result.exists() -def LS = System.getProperty("line.separator") +def LS = System.lineSeparator() assert result.text.find('(?s)' + ' org.apache.maven.plugins' + LS + ' maven-help-plugin' diff --git a/src/it/projects/effective-pom-multimodule-artifact/verify.groovy b/src/it/projects/effective-pom-multimodule-artifact/verify.groovy index fae54ade..39401cd9 100644 --- a/src/it/projects/effective-pom-multimodule-artifact/verify.groovy +++ b/src/it/projects/effective-pom-multimodule-artifact/verify.groovy @@ -23,7 +23,7 @@ assert content.indexOf( "" ) == -1 def result = new File(basedir, 'result.txt'); assert result.exists() -def LS = System.getProperty("line.separator") +def LS = System.lineSeparator() assert result.text.find('(?s)' + ' org.apache.maven.plugins' + LS + ' maven-help-plugin' diff --git a/src/it/projects/effective-pom_properties/verify.groovy b/src/it/projects/effective-pom_properties/verify.groovy index fc6823a0..fc71c7b8 100644 --- a/src/it/projects/effective-pom_properties/verify.groovy +++ b/src/it/projects/effective-pom_properties/verify.groovy @@ -19,7 +19,7 @@ def buildLog = new File(basedir, 'build.log'); assert buildLog.exists() -def LS = System.getProperty("line.separator") +def LS = System.lineSeparator() if (mavenVersion.startsWith('4.')) { // with Maven 4, order of properties is reversed from original pom.xml assert buildLog.text.find( diff --git a/src/main/java/org/apache/maven/plugins/help/AbstractHelpMojo.java b/src/main/java/org/apache/maven/plugins/help/AbstractHelpMojo.java index 42178756..94485fd8 100644 --- a/src/main/java/org/apache/maven/plugins/help/AbstractHelpMojo.java +++ b/src/main/java/org/apache/maven/plugins/help/AbstractHelpMojo.java @@ -52,7 +52,7 @@ public abstract class AbstractHelpMojo extends AbstractMojo { protected static final int LINE_LENGTH = 79; /** The line separator for the current OS. */ - protected static final String LS = System.getProperty("line.separator"); + protected static final String LS = System.lineSeparator(); /** * Current Maven project. diff --git a/src/test/java/org/apache/maven/plugins/help/DescribeMojoTest.java b/src/test/java/org/apache/maven/plugins/help/DescribeMojoTest.java index 5d64e37c..7083f9c4 100644 --- a/src/test/java/org/apache/maven/plugins/help/DescribeMojoTest.java +++ b/src/test/java/org/apache/maven/plugins/help/DescribeMojoTest.java @@ -85,7 +85,7 @@ void testValidExpression() throws Exception { parameter.setExpression("${valid.expression}"); md.addParameter(parameter); - String ls = System.getProperty("line.separator"); + String ls = System.lineSeparator(); Method describeMojoParameters = DescribeMojo.class.getDeclaredMethod( "describeMojoParameters", MojoDescriptor.class, StringBuilder.class);