2

When all output from gradle is redirected like

gradle clean build > buildlog 2>&1

java compiler warnings output like

...
:build
:application:compileJava/var/lib/jenkins/jobs/some/path/somefile.java:87: warning: somewarningtext
1 warning

:application:processResources

Note that there are no spaces nor linefeeds between application:compileJava and the warning text. It would be ok but we use Jenkins gradle plugin and it outputs executed gradle task names in a box that is meant to be narrow.

But it contains :application:compileJava/var/lib/jenkins/jobs/some/path/somefile.java:87: warning: somewarningtext instead of just :application:compileJava and causes build log to display in a weird way:

weird jenkins build log display

Do I have some workarounds to apply in that case? I want build log to be readable.

Andrey Regentov
  • 3,687
  • 4
  • 34
  • 40

1 Answers1

4

One workaround might be to add a linebreak by your own for all tasks of type compile:

allprojects{
    tasks.withType(JavaCompile){
        doFirst{println "\n"}
    }
}
Rene Groeschke
  • 27,999
  • 10
  • 69
  • 78