From dcb91836aff63550313d3cd498a68c2e9e9d4e89 Mon Sep 17 00:00:00 2001 From: Elliotte Rusty Harold Date: Wed, 4 Dec 2024 08:52:04 -0500 Subject: [PATCH] wip --- src/it/projects/mdep-839-list/verify.groovy | 6 +++--- .../dependency/resolvers/ResolveDependenciesMojo.java | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/it/projects/mdep-839-list/verify.groovy b/src/it/projects/mdep-839-list/verify.groovy index d526ceeacd..11e5f395e7 100644 --- a/src/it/projects/mdep-839-list/verify.groovy +++ b/src/it/projects/mdep-839-list/verify.groovy @@ -22,7 +22,7 @@ assert file.exists() : "output file $file does not exist" String output = file.getText( "UTF-8" ) assert output.contains( 'The following files have been resolved:') -for (char c : output) { // no escape codes - assert c != 27; -} +// no escape codes +assert !output.contains( '\u001B' ) + diff --git a/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependenciesMojo.java b/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependenciesMojo.java index 0a78115095..c939ec4d88 100644 --- a/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependenciesMojo.java +++ b/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependenciesMojo.java @@ -184,11 +184,11 @@ private StringBuilder buildArtifactListOutput( Set artifacts, boolean outputAbsoluteArtifactFilename, boolean theOutputScope, boolean theSort) { StringBuilder sb = new StringBuilder(); List artifactStringList = new ArrayList<>(); - if (outputFile != null) { - // MessageUtils.setColorEnabled(false); + /* if (outputFile != null) { + MessageUtils.setColorEnabled(false); } else { MessageUtils.setColorEnabled(true); - } + } */ for (Artifact artifact : artifacts) { MessageBuilder messageBuilder = MessageUtils.buffer(); messageBuilder.a(" "); @@ -230,7 +230,7 @@ private StringBuilder buildArtifactListOutput( } } } - artifactStringList.add(messageBuilder + System.lineSeparator()); + artifactStringList.add(messageBuilder.build() + System.lineSeparator()); } if (theSort) { Collections.sort(artifactStringList);