Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,12 @@ under the License.
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.fusesource.jansi</groupId>
<artifactId>jansi</artifactId>
<version>2.4.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
Expand Down Expand Up @@ -452,6 +457,7 @@ under the License.
<failOnWarning>true</failOnWarning>
<ignoredUnusedDeclaredDependencies combine.children="append">
<!-- used in tests runtime -->
<ignoredUnusedDeclaredDependency>org.fusesource.jansi:jansi</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>org.apache.maven.resolver:maven-resolver-connector-basic</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>org.apache.maven.resolver:maven-resolver-transport-file</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>org.apache.maven.resolver:maven-resolver-transport-http</ignoredUnusedDeclaredDependency>
Expand Down
2 changes: 1 addition & 1 deletion src/it/projects/mdep-839-list/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<name>Test</name>
<description>
Test dependency:list-repositories
Test dependency:list
</description>

<properties>
Expand Down
13 changes: 12 additions & 1 deletion src/it/projects/mdep-839-list/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,21 @@

File file = new File( basedir, "classpath.txt" )
assert file.exists() : "output file $file does not exist"

String output = file.getText( "UTF-8" )
assert output.startsWith( 'The following files have been resolved:')
// no escape codes
assert !output.contains( '\u001B' )

// expected output depends on whether we have a version of Java that supports modules or not
def javaVersion = System.getProperty("java.specification.version")
def majorVersion = (javaVersion.startsWith("1.") ? javaVersion.split("\\.")[1] : javaVersion).toInteger()

if (majorVersion >= 9) {
assert output.contains('compile -- module') : "Output should contain module compilation info on Java 9+"
} else {
assert output.contains( 'compile' )
}




Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,6 @@ private StringBuilder buildArtifactListOutput(
Set<Artifact> artifacts, boolean outputAbsoluteArtifactFilename, boolean theOutputScope, boolean theSort) {
StringBuilder sb = new StringBuilder();
List<String> artifactStringList = new ArrayList<>();
/* if (outputFile != null) {
MessageUtils.setColorEnabled(false);
} else {
MessageUtils.setColorEnabled(true);
} */
for (Artifact artifact : artifacts) {
MessageBuilder messageBuilder = MessageUtils.buffer();
messageBuilder.a(" ");
Expand Down Expand Up @@ -251,7 +246,11 @@ private StringBuilder buildArtifactListOutput(
}
}
}
artifactStringList.add(messageBuilder.build() + System.lineSeparator());
String message = messageBuilder.build();
if (outputFile != null) {
message = MessageUtils.stripAnsiCodes(message);
}
artifactStringList.add(message + System.lineSeparator());
}
if (theSort) {
Collections.sort(artifactStringList);
Expand Down
Loading