Skip to content

Commit

Permalink
[MPH-185] Restore location format for effective-pom
Browse files Browse the repository at this point in the history
Was changed by accident in 4f9e3af
  • Loading branch information
slawekjaranowski committed Mar 12, 2023
1 parent a8bd97c commit ff5cfc1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/it/projects/effective-pom-verbose/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@
String content = new File( basedir, "build.log" ).text

// comments in the same line
assert content.contains( "<groupId>org.apache.maven.its.help</groupId> <!-- " )
assert content.contains( "<groupId>org.apache.maven.its.help</groupId> <!-- org.apache.maven.its.help:test:1.0-SNAPSHOT," )
assert content.contains( "<url>https://maven.apache.org/plugins/test/</url> <!-- org.apache.maven.plugins:maven-plugins:33, line 37 -->" )
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,11 @@ private static class InputLocationStringFormatter extends InputLocation.StringFo
public String toString(InputLocation location) {
InputSource source = location.getSource();

String s = source.getLocation(); // by default, display the path
String s = source.getModelId(); // by default, display modelId

if (s == null || s.trim().isEmpty()) {
s = source.getModelId();
if (StringUtils.isBlank(s) || s.contains("[unknown-version]")) {
// unless it is blank or does not provide version information
s = source.toString();
}

return '}' + s + ((location.getLineNumber() >= 0) ? ", line " + location.getLineNumber() : "") + ' ';
Expand Down

0 comments on commit ff5cfc1

Please sign in to comment.