Open maffe opened 1 month ago
the output window is not a fully featured terminal, it doesn't support meta information in the text. If it would be a terminal, you wouldn't have to force color output, it would automatically activate.
I think we are seeing an issue that is caused by ansi escape sequences in the output of maven. Without having looked deeper into the problem, the integration code basicly parses the output of maven and reacts accordingly. #7113 adjusted the matching pattern to fix one problem. Coloring adds sequences to the output, that are not displayed text, but code colors/behavior.
Either the matches need to be adjusted to support ansi escape sequences. Or they need to be stripped out before the existing matchers are processed.
forcing coloring and then stripping text decorations again while adding more custom coloring will lead to other issues most likely. This sounds also like a bit too much patchwork and might not be something we should sink time into.
Maven is smart enough to detect not fully featured terminals and turn coloring off. The forward looking fix would be to switch the output to a proper terminal. This is more work though and windows is missing a good impl atm https://github.com/apache/netbeans/issues/3959.
btw: the issue goes deeper, mvnd for example really likes fully featured terminals since it outputs log in parallel which rewrites terminal lines. To work within NB it switches to a simple impl which serializes the output again.
I think you are wrong. The author works around #6210 by forcing maven to output color codes and This works:
Normal output:
Output with "--color always":
So the output window of NetBeans happily parses the escape sequences and outputs them.
What I see is this:
JUnitOutputListenerProvider
will not match the lines it should matchAll referenced issues may be related, but don't match.
cmd
/powershell
as shell. I ran cmd
inside a the NetBeans terminal emulator at least once, so the terminal emulator of NetBeans is enough to support the output of cmd
, powershell
needs another test. I suspect the hard part is to see, that the features the NB Terminal emulator provides with bash
also work with cmd
(launching with a working directory, receiving title updates).tty
and thus falls back to not sending ansi sequences.color
parameter explicitly overruled by author.I know that the current output can render some decorations, this causes several problems. NB is coloring the output too without anticipating it to be in color already, and none of the output line handlers expect decorated text at the moment. You see that in your output that nothing is filtered, code folding is off and mojo specific handlers will likely also not work.
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
--color always
to Maven Global Execution Options in NetBeans settingsWithout
--color always
:[INFO]
BUILD SUCCESS
Total time: 3.984 s Finished at: 2024-06-06T10:36:19+02:00
[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] ------------------------------------------------------------------------