Spring-boot: Output generated by Gradle plugin's bootRun task isn't color-coded

Created on 28 Apr 2014  路  6Comments  路  Source: spring-projects/spring-boot

spring-boot:run in the Maven plugin produces color-coded output, whereas bootRun in the Gradle plugin does not

enhancement

Most helpful comment

This setting worked for me:

bootRun {
    jvmArgs = ["-Dspring.output.ansi.enabled=ALWAYS"]
}

Source: http://stackoverflow.com/questions/28783832/getting-spring-boot-color-console-logging-working-within-intellij

All 6 comments

Is there any plan to fix this?

Yes, although we don't consider it high priority. Contributions are most welcome.

Issue #2331 seems similar to this one.

This setting worked for me:

bootRun {
    jvmArgs = ["-Dspring.output.ansi.enabled=ALWAYS"]
}

Source: http://stackoverflow.com/questions/28783832/getting-spring-boot-color-console-logging-working-within-intellij

@nickgrealy Your JVM flag certainly works. However, it's a problem when using Gradle to launch the program in a non-terminal environment, such as CI.

@nickgrealy thx for advice!

However, if working with Kotlin you might need to add following to your build.gradle.kts :

tasks.bootRun {
    jvmArgs = listOf("-Dspring.output.ansi.enabled=ALWAYS")
}

Worked for my project: Gradle 5.4.1, Kotlin 1.3.21, Spring 2.1.6.RELEASE

Was this page helpful?
0 / 5 - 0 ratings