From a3fac7a7bea5e4ec77ab09b20f69d641eb2ab25e Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Fri, 4 Dec 2020 17:23:47 +0100 Subject: [PATCH 1/2] Fix debug output of plugin class path --- .../java/org/codehaus/gmavenplus/mojo/AbstractGroovyMojo.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/org/codehaus/gmavenplus/mojo/AbstractGroovyMojo.java b/src/main/java/org/codehaus/gmavenplus/mojo/AbstractGroovyMojo.java index 6d6f8b050..d375c8b2f 100644 --- a/src/main/java/org/codehaus/gmavenplus/mojo/AbstractGroovyMojo.java +++ b/src/main/java/org/codehaus/gmavenplus/mojo/AbstractGroovyMojo.java @@ -114,6 +114,7 @@ protected void logPluginClasspath() { StringBuilder sb = new StringBuilder(); for (Artifact artifact : pluginArtifacts) { sb.append(artifact.getFile()); + sb.append(", "); } getLog().debug("Plugin classpath:\n" + sb.toString()); } From 1236b9e9d24af7dba5ad41ab47d1888037a38e33 Mon Sep 17 00:00:00 2001 From: Keegan Witt Date: Sat, 5 Dec 2020 02:03:29 -0500 Subject: [PATCH 2/2] Include space after commas, and don't add trailing comma --- .../org/codehaus/gmavenplus/mojo/AbstractGroovyMojo.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/codehaus/gmavenplus/mojo/AbstractGroovyMojo.java b/src/main/java/org/codehaus/gmavenplus/mojo/AbstractGroovyMojo.java index d375c8b2f..5f71a0d0c 100644 --- a/src/main/java/org/codehaus/gmavenplus/mojo/AbstractGroovyMojo.java +++ b/src/main/java/org/codehaus/gmavenplus/mojo/AbstractGroovyMojo.java @@ -112,9 +112,11 @@ public abstract class AbstractGroovyMojo extends AbstractMojo { protected void logPluginClasspath() { if (getLog().isDebugEnabled()) { StringBuilder sb = new StringBuilder(); - for (Artifact artifact : pluginArtifacts) { - sb.append(artifact.getFile()); - sb.append(", "); + for (int i = 0; i < pluginArtifacts.size(); i++) { + sb.append(pluginArtifacts.get(i).getFile()); + if (i < pluginArtifacts.size() - 1) { + sb.append(", "); + } } getLog().debug("Plugin classpath:\n" + sb.toString()); }