Skip to content

Remove the Jansi dependency - #451

Open
slachiewicz wants to merge 1 commit into
apache:masterfrom
slachiewicz:drop-jansi
Open

slachiewicz wants to merge 1 commit into
apache:masterfrom
slachiewicz:drop-jansi

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

org.apache.maven.shared.utils.logging no longer depends on Jansi. It writes the ANSI escape sequences itself and calls the org.fusesource.jansi API that Maven core exports only through reflection, because that API is how a plugin learns Maven's color setting. Maven 3.9 exports real Jansi, and Maven 3.10 exports compatible Ansi, AnsiConsole, AnsiPrintStream and AnsiMode classes, including after apache/maven#13888. Without them, output stays plain, as before.

The output is the same as Jansi 2.4.3 produced, byte for byte, with color enabled and disabled; MessageUtilsTest checks this against Jansi, which stays a test dependency. The public API doesn't change.

Verified: mvn verify → 806 tests, 0 failures; checkstyle, RAT and spotless pass. I have not run a plugin under a real Maven 3.9 or 3.10 with this build.

The logging package writes ANSI escape sequences itself and reaches the
org.fusesource.jansi API only through reflection. That API is how a
plugin learns Maven's color setting: Maven 3.9 exports real Jansi, and
Maven 3.10 exports compatible Ansi, AnsiConsole, AnsiPrintStream and
AnsiMode classes. Keep the reflective lookup; linking Jansi directly
again would tie the library to an artifact Maven no longer ships.
@slachiewicz slachiewicz added dependencies Pull requests that update a dependency file enhancement New feature or request labels Nov 8, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review November 8, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant