openrewrite / rewrite-github-actions

OpenRewrite recipes for performing GitHub action hygiene and migration tasks.
Apache License 2.0
9 stars 10 forks source link

Colorize GitHub Actions output for Maven #20

Open timtebeek opened 1 year ago

timtebeek commented 1 year ago

When using -B or --batch-mode, colorized output is disabled, which is fairly common to use with GitHub Actions, even though GitHub supports colorized output. Color output can be turned on again with -Dstyle.color=always, as seen here.

I'd propose to add -Dstyle.color=always to lines containing both mvn and --batch-mode, or environment variables such as MAVEN_OPTS or MAVEN_ARGS, or in .mvn/maven.config if batch-mode is configured there.

Optional to only add this when using Maven 3.5.0 or above, although ideally we bump the Maven wrapper.

Might be a small change, but when applied in bulk it adds a consistent experience of colorized output, for an improved user experience.