diff --git a/src/main/java/hudson/plugins/gradle/TimestampPrefixDetector.java b/src/main/java/hudson/plugins/gradle/TimestampPrefixDetector.java index 0463ede7..6e235775 100644 --- a/src/main/java/hudson/plugins/gradle/TimestampPrefixDetector.java +++ b/src/main/java/hudson/plugins/gradle/TimestampPrefixDetector.java @@ -6,7 +6,7 @@ class TimestampPrefixDetector { static final String TimestampPattern = "\\[\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z\\] "; - private static final Pattern TimestampPatternR = Pattern.compile("^(" + TimestampPattern + ").*\n?$"); + private static final Pattern TimestampPatternR = Pattern.compile("^(" + TimestampPattern + ").*(?:\r?\n)?$"); static String trimTimestampPrefix(int prefix, String line) { return line.substring(prefix); diff --git a/src/test/groovy/hudson/plugins/gradle/GradleConsoleAnnotatorIntegrationTest.groovy b/src/test/groovy/hudson/plugins/gradle/GradleConsoleAnnotatorIntegrationTest.groovy index e3fa69a0..05a78599 100644 --- a/src/test/groovy/hudson/plugins/gradle/GradleConsoleAnnotatorIntegrationTest.groovy +++ b/src/test/groovy/hudson/plugins/gradle/GradleConsoleAnnotatorIntegrationTest.groovy @@ -43,7 +43,6 @@ class GradleConsoleAnnotatorIntegrationTest extends BaseGradleIntegrationTest { def b = j.buildAndAssertSuccess(pipelineJob) then: - println "logs: \n${JenkinsRule.getLog(b)}" def client = j.createWebClient() def html = client.goTo(b.getUrl() + "console") html.getByXPath("//b[@class='gradle-task']")*.textContent*.toString() == [