netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

Test results window does not work with colored Maven output

Open maffe opened this issue 8 months ago • 5 comments

Apache NetBeans version

Apache NetBeans 22

What happened

The test results window does not show up automatically when selecting “Test” in a project’s context menu. After opening it via Window → IDE Tools → Test Results, it stays empty even when running the tests again.

Language / Project Type / NetBeans Component

Java Maven Project

How to reproduce

  • Create a Maven project with unit tests
  • Add --color always to Maven Global Execution Options in NetBeans settings
  • Run tests

Without --color always:

  • Output does not contain prefixes like [INFO]
  • Output contains almost no colors
  • Example output:
Tests run: 18, Failures: 0, Errors: 0, Skipped: 0

------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time:  3.984 s
Finished at: 2024-06-06T10:36:19+02:00
------------------------------------------------------------------------

With --color always:

  • Output does contain prefixes like [INFO] (with the letters colored blue, or yellow in case of warnings)
  • Some messages like Tests run: 18, Failures: 0, Errors: 0, Skipped: 0 and BUILD SUCCESS appear in green
  • NETBEANS-ExecEvent entries are visible
  • Example output:
[INFO] Tests run: 18, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] NETBEANS-ExecEvent:{"mojo":{"phase":"test","loc":{"col":-1,"ln":-1,"id":"org.apache.maven:maven-core:3.9.3:default-lifecycle-bindings"},"impl":"org.apache.maven.plugin.surefire.SurefirePlugin","urls":["file:\/C:\/…\/org\/apache\/maven\/plugins\/maven-surefire-plugin\/3.2.5\/maven-surefire-plugin-3.2.5.jar","file:\/C:\/…\/org\/apache\/maven\/surefire\/maven-surefire-common\/3.2.5\/maven-surefire-common-3.2.5.jar","file:\/C:\/…\/org\/apache\/maven\/surefire\/surefire-api\/3.2.5\/surefire-api-3.2.5.jar","file:\/C:\/…\/org\/apache\/maven\/surefire\/surefire-logger-api\/3.2.5\/surefire-logger-api-3.2.5.jar","file:\/C:\/…\/org\/apache\/maven\/surefire\/surefire-extensions-api\/3.2.5\/surefire-extensions-api-3.2.5.jar","file:\/C:\/…\/org\/apache\/maven\/surefire\/surefire-booter\/3.2.5\/surefire-booter-3.2.5.jar","file:\/C:\/…\/org\/apache\/maven\/surefire\/surefire-extensions-spi\/3.2.5\/surefire-extensions-spi-3.2.5.jar","file:\/C:\/…\/org\/apache\/maven\/shared\/maven-common-artifact-filters\/3.1.1\/maven-common-artifact-filters-3.1.1.jar","file:\/C:\/…\/commons-io\/commons-io\/2.15.1\/commons-io-2.15.1.jar","file:\/C:\/…\/org\/codehaus\/plexus\/plexus-java\/1.2.0\/plexus-java-1.2.0.jar","file:\/C:\/…\/org\/ow2\/asm\/asm\/9.6\/asm-9.6.jar","file:\/C:\/…\/com\/thoughtworks\/qdox\/qdox\/2.0.3\/qdox-2.0.3.jar","file:\/C:\/…\/org\/apache\/maven\/surefire\/surefire-shared-utils\/3.2.5\/surefire-shared-utils-3.2.5.jar"],"goal":"test","id":"org.apache.maven.plugins:maven-surefire-plugin:3.2.5","source":"LIFECYCLE","execId":"default-test"},"type":"MojoSucceeded"}
[INFO] NETBEANS-ExecEvent:{"prj":{"file":"C:\\…","id":"…"},"type":"ProjectSucceeded"}
[INFO] NETBEANS-ExecEvent:{"prjcount":1,"type":"SessionEnded"}
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.011 s
[INFO] Finished at: 2024-06-06T10:34:59+02:00
[INFO] ------------------------------------------------------------------------

Did this work correctly in an earlier version?

No / Don't know

Operating System

Windows 10 64 Bit

JDK

OpenJDK 22

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

Full Maven Global execution options are --batch-mode --errors --color always --show-version --strict-checksums -Djavax.net.ssl.trustStore=foo.jks -Daether.remoteRepositoryFilter.prefixes=true

Previously reported as #4734

--color always also breaks other things like links to source code in Javadoc warnings and stack traces

Are you willing to submit a pull request?

No

maffe avatar Jun 06 '24 08:06 maffe