Skip to content

Commit 17d39ae

Browse files
committed
[cross] For better cross platform support, use the system line separator
1 parent 94eece5 commit 17d39ae

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/main/groovy/org/codehaus/mojo/spotbugs/BaseViolationCheckMojo.groovy

+2-2
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo {
508508
log.info('No errors/warnings found')
509509
return
510510
} else if (maxAllowedViolations > 0 && bugCount <= maxAllowedViolations) {
511-
log.info("total ${bugCount} violations are found which is set to be acceptable using configured property maxAllowedViolations :"+maxAllowedViolations +".\nBelow are list of bugs ignored :\n")
511+
log.info("total ${bugCount} violations are found which is set to be acceptable using configured property maxAllowedViolations :" + maxAllowedViolations + "." + SpotBugsInfo.EOL + "Below are list of bugs ignored :" + SpotBugsInfo.EOL)
512512
printBugs(bugCount, bugs)
513513
return;
514514
}
@@ -536,7 +536,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo {
536536
}
537537
}
538538

539-
log.info('\n\n\nTo see bug detail using the Spotbugs GUI, use the following command "mvn spotbugs:gui"\n\n\n')
539+
log.info(SpotBugsInfo.EOL + SpotBugsInfo.EOL + SpotBugsInfo.EOL + 'To see bug detail using the Spotbugs GUI, use the following command "mvn spotbugs:gui"' + SpotBugsInfo.EOL + SpotBugsInfo.EOL + SpotBugsInfo.EOL)
540540

541541
if ((bugCountAboveThreshold || errorCount) && failOnError) {
542542
throw new MojoExecutionException("failed with ${bugCountAboveThreshold} bugs and ${errorCount} errors ")

src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsInfo.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ interface SpotBugsInfo {
8282

8383
static final String PERIOD = "."
8484

85-
static final EOL = "\n"
85+
static final EOL = System.lineSeparator()
8686

8787
static final String URL = "url"
8888

src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsMojo.groovy

+2-2
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait {
10531053

10541054
auxClasspathList.each() { auxClasspathElement ->
10551055
log.debug(" Adding to AuxClasspath ->" + auxClasspathElement.toString())
1056-
auxClasspathFile << auxClasspathElement.toString() + "\n"
1056+
auxClasspathFile << auxClasspathElement.toString() + SpotBugsInfo.EOL
10571057
}
10581058
}
10591059
}
@@ -1244,7 +1244,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait {
12441244
writer.write "<?xml version=\"1.0\" encoding=\"" + effectiveEncoding.toLowerCase(Locale.ENGLISH) + "\"?>"
12451245
}
12461246

1247-
writer.write "\n"
1247+
writer.write SpotBugsInfo.EOL
12481248

12491249
writer << xmlBuilder.bind { mkp.yield path }
12501250
} else {

0 commit comments

Comments
 (0)