Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to enable color-coded output from bootRun #24169

Closed
wilkinsona opened this issue Nov 16, 2020 · 3 comments
Closed

Document how to enable color-coded output from bootRun #24169

wilkinsona opened this issue Nov 16, 2020 · 3 comments
Labels
status: declined A suggestion or change that we don't feel we should currently apply type: bug A general bug

Comments

@wilkinsona
Copy link
Member

We made a change way back in 1.3 to enable colour-coded output when running the bootRun task in Gradle. The colour seems to have been lost again. Testing with old versions of Spring Boot suggests that something changed in Gradle 3.0. We get coloured output with 2.14.1 but its lost when upgrading to Gradle 3.0 without changing the version of Spring Boot. It'd be nice to see if we can get it back again somehow.

@wilkinsona wilkinsona added the type: bug A general bug label Nov 16, 2020
@wilkinsona wilkinsona added this to the 2.2.x milestone Nov 16, 2020
@wilkinsona
Copy link
Member Author

When building both with and without the daemon, System.getConsole() returns null so BootRun doesn't set spring.output.ansi.console-available to true in the forked process's environment. The colour-coded output can be enabled by setting the environment variable in build.gradle:

bootRun {
    environment 'spring.output.ansi.console-available', true
}

@philwebb philwebb modified the milestones: 2.2.x, 2.3.x Dec 16, 2020
@wilkinsona wilkinsona changed the title Output generated by Gradle plugin's bootRun task isn't color-coded Document how to enable color-coded output from bootRun May 4, 2021
@wilkinsona wilkinsona added type: documentation A documentation update and removed type: bug A general bug labels May 4, 2021
@wilkinsona
Copy link
Member Author

It no longer appears to be possible for us to detect the console automatically and set the necessary environment variable. Closing.

@wilkinsona wilkinsona added status: declined A suggestion or change that we don't feel we should currently apply type: bug A general bug and removed type: documentation A documentation update labels May 4, 2021
@wilkinsona wilkinsona removed this from the 2.3.x milestone May 4, 2021
@philwebb
Copy link
Member

See gradle/gradle#1251 for details on the Sytem.getConsole() change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants