Skip to content
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

[MNG-7995] Switch to JLine to provide line editing #1279

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

gnodet
Copy link
Contributor

@gnodet gnodet commented Oct 13, 2023

JIRA issue: https://issues.apache.org/jira/browse/MNG-7995
JLine used for:

  • output display
  • prompting

It should also be used in the future for better transfer display, i.e. rewriting ConsoleMavenTransferListener, still TODO, see #1302 as a possible base.

@slawekjaranowski
Copy link
Member

Will it be compatible with Maven 3.x and old maven-shared-utils?

@gnodet
Copy link
Contributor Author

gnodet commented Oct 13, 2023

Will it be compatible with Maven 3.x and old maven-shared-utils?

In what sense should that be compatible ? You mean if a plugin is using maven-shared-utils and use that to output stuff ? Do you have a specific plugin in mind that I could try ?

I've done some test with the archetype plugin which is using the Prompter and that works nicely. I haven't specifically checked plugins using org.apache.maven.shared.logging.MessageUtils though.

@slawekjaranowski
Copy link
Member

eg.

mvn buildplan:list-phase

@gnodet gnodet marked this pull request as draft October 13, 2023 13:34
@gnodet
Copy link
Contributor Author

gnodet commented Oct 13, 2023

eg.

mvn buildplan:list-phase

It works when using a terminal. However, when the output is redirected to a file, the ansi sequences are not stripped correctly when using the org.apache.maven.shared.logging.MessageUtils.
The reason is that the ansi sequences are currently stripped inside the System.out and System.err streams.
So I'll postpone this change until jline/jline3#871 is done and released.

@gnodet gnodet added this to the 4.0.0 milestone Oct 13, 2023
@gnodet gnodet modified the milestones: 4.0.0, 4.0.0-alpha-11 Dec 18, 2023
@gnodet gnodet force-pushed the jline branch 2 times, most recently from b059ad7 to 9f3733c Compare December 23, 2023 21:15
@gnodet gnodet marked this pull request as ready for review December 23, 2023 21:15
@gnodet
Copy link
Contributor Author

gnodet commented Dec 23, 2023

eg.

mvn buildplan:list-phase

It works when using a terminal. However, when the output is redirected to a file, the ansi sequences are not stripped correctly when using the org.apache.maven.shared.logging.MessageUtils. The reason is that the ansi sequences are currently stripped inside the System.out and System.err streams. So I'll postpone this change until jline/jline3#871 is done and released.

I've upgrade to latest JLine, which now includes Jansi. The integration with maven-shared-utils works correctly now.

@gnodet
Copy link
Contributor Author

gnodet commented Jan 8, 2024

@slawekjaranowski would you mind having a look ?

@gnodet gnodet changed the title Switch to JLine to provide line editing [MNG-7995] Switch to JLine to provide line editing Jan 8, 2024
@gnodet gnodet merged commit 782e867 into apache:master Jan 8, 2024
18 checks passed
@gnodet gnodet deleted the jline branch January 10, 2024 12:06
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