-
Notifications
You must be signed in to change notification settings - Fork 874
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
Disable ANSI decorations for default (embedded) maven logger. #6843
Conversation
java/maven.embedder/src/org/netbeans/modules/maven/embedder/EmbedderFactory.java
Outdated
Show resolved
Hide resolved
A question: I understand it is desirable to disable ansi output for testing, but wouldn't it affect some IDE operations that use Embedder ? Would it be possible to disable the coloring conditionally (i.e. some system property set up by the test infrastructure) ? |
@sdedic I convert this back to draft since this trick isn't working anymore today for some reason. (can't explain it, i swear it worked yesterday) But regarding what is affected: the messags.log is ansi decorated too, the screenshot above is the log opened with my default text editor on linux (xed) - it doesn't look much better when opened in NB. This creates a mess when pasted into issue forms etc. edit: |
maven-slf4j-provider injects MavenSimpleLogger which decorates the output for terminal use. This causes problems in log files, tests etc which don't expect or cant display them properly.
7a452a0
to
036d646
Compare
<!-- | ||
disable Maven's ANSI CLI decorations | ||
maven-slf4j-provider injects MavenSimpleLogger which decorates the output for terminal use | ||
this causes problems in log files, tests etc which don't expect or cant display them properly | ||
<class-path-extension> | ||
<runtime-relative-path>../maven/lib/jansi-2.4.0.jar</runtime-relative-path> | ||
</class-path-extension> | ||
--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thats likely the best way to be 100% sure that it is working:
here is the maven code:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great !!
maven-slf4j-provider
injectsMavenSimpleLogger
which decorates the output for terminal use. This causes problems in log files, tests etc which don't expect or cant display them properly.a quick way to test this:
run
NexusRepositoryIndexerImplTest#testFilterPluginGroupIdsRepositoryQueries
directly from NB and check that there is no color in the stack trace. TheTEST-org.netbeans.modules.maven.indexer.NexusRepositoryIndexerImplTest.xml
should also have no escaped ANSI symbols in it.long way to test would be to run NB and check that the log file is clean.

this is how it should not look: