Skip to content

Conversation

@elharo
Copy link
Contributor

@elharo elharo commented Dec 17, 2025

fixes #1475
fixes #1344

@tiffmaelite

@elharo elharo marked this pull request as ready for review December 17, 2025 22:24
@elharo elharo changed the title strip ansi codes when writing to a file [[MDEP-974] strip ansi codes when writing to a file Dec 18, 2025
@elharo elharo changed the title [[MDEP-974] strip ansi codes when writing to a file [MDEP-974] strip ansi codes when writing to a file Dec 18, 2025
@elharo
Copy link
Contributor Author

elharo commented Dec 18, 2025

what I don't understand is why mdep-839-list isn't picking up this issue

@elharo elharo marked this pull request as draft December 19, 2025 13:48
@elharo elharo requested a review from Copilot December 19, 2025 13:48
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses issues #1475 and #1344 by implementing ANSI code stripping when writing dependency output to files, replacing the previous commented-out approach of globally disabling color output.

Key Changes

  • Strips ANSI escape codes from output when writing to a file instead of disabling colors at the source
  • Adds conditional ANSI stripping logic in the artifact list building process
  • Changes module output format from " -- module" to " - module"

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependenciesMojo.java Removes commented color control code, adds ANSI stripping logic when outputFile is set, and changes module separator format
src/it/projects/mdep-839-list/verify.groovy Adds assertion to verify ANSI codes are removed and module format is present in output file
src/it/projects/mdep-839-list/pom.xml Updates test description from "list-repositories" to "list"
pom.xml Adds jansi 2.4.2 dependency with test scope and configures it as ignored in dependency analyzer
Comments suppressed due to low confidence (1)

src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependenciesMojo.java:238

  • Changing from " -- module " to " - module " will break multiple existing integration tests that expect the double-dash format. Tests in mdep-571-resolve-java9, mdep-580_display-manifest-automodules, and mdep-839-list all check for " -- module" in their output. If this format change is intentional, all affected tests must be updated; otherwise, revert this change to maintain backward compatibility.
                    messageBuilder.project(" -- module " + moduleDescriptor.name);

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@elharo elharo marked this pull request as ready for review December 19, 2025 15:24
@elharo elharo requested review from dkulp and slachiewicz December 19, 2025 15:25
@elharo elharo merged commit 38664c4 into master Dec 19, 2025
36 checks passed
@elharo elharo deleted the esc branch December 19, 2025 18:26
@github-actions github-actions bot added this to the 3.9.1 milestone Dec 19, 2025
@github-actions
Copy link

@elharo Please assign appropriate label to PR according to the type of change.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MDEP-974] ANSI color sequences are output to files [MDEP-839] dependency:list should output a plain list when used with a file

2 participants