Skip to content

Conversation

@cstamas
Copy link
Member

@cstamas cstamas commented Jan 22, 2025

@cstamas cstamas self-assigned this Jan 22, 2025
@cstamas cstamas changed the title [MNG-8535] WIP [MNG-8535] Ability to capture stdout with maven-executor Jan 22, 2025
try (Invoker invoker = createInvoker()) {
return invoker.invoke(parseArguments(args));
ParserRequest.Builder parserRequestBuilder = parserRequestBuilder(args);
if (in != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't those checks useless ?
It's definitely no big deal, but

ParserRequest parserRequestBuilder = parserRequestBuilder(args)
        .in(in).out(out).err(err)
        .build();


protected void doConfigureWithTerminal(C context, Terminal terminal) {
context.terminal = terminal;
MessageUtils.setColorEnabled(Objects.requireNonNullElseGet(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have two calls to MessageUtils.setColorEnabled ? Shouldn't only one be sufficient ?

try {
if (r.stdoutConsumer().isPresent()
|| r.stderrConsumer().isPresent()) {
System.setProperty("org.jline.terminal.output", "out");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have JLine in the classpath, right ? Else TerminalBuilder.PROP_OUTPUT would be more appropriate.

.jansi(false)
.jna(false)
.jni(true)
.name("Maven");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may still want to have dumb(true).
For example if we are on an unsupported os/architecture combination, we'll end up with a dumb terminal, but with an annoying warning (and nothing the user can do)...

Currently JAnsi always goes for system out
via Process file handle.

---

https://issues.apache.org/jira/browse/MNG-8535
@cstamas
Copy link
Member Author

cstamas commented Jan 31, 2025

This PR is superseded by several others. Dropping this one.

@cstamas cstamas closed this Jan 31, 2025
@cstamas cstamas deleted the MNG-8535 branch January 31, 2025 17:04
@jira-importer
Copy link

Resolve #9907

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants