adangel commented on code in PR #728:
URL: https://github.com/apache/maven-pmd-plugin/pull/728#discussion_r3977215548
##########
src/main/java/org/apache/maven/plugins/pmd/exec/Executor.java:
##########
@@ -29,37 +29,83 @@
import java.net.URLClassLoader;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
import org.codehaus.plexus.logging.console.ConsoleLogger;
+import org.codehaus.plexus.util.IOUtil;
abstract class Executor {
- protected static String buildClasspath() {
- StringBuilder classpath = new StringBuilder();
+ protected static String buildClasspath(String javaExecutable) {
+ List<String> classpath = new ArrayList<>();
// plugin classpath needs to come first
ClassLoader pluginClassloader = Executor.class.getClassLoader();
- buildClasspath(classpath, pluginClassloader);
+ classpath.addAll(buildClasspath(pluginClassloader));
ClassLoader coreClassloader = ConsoleLogger.class.getClassLoader();
- buildClasspath(classpath, coreClassloader);
+ classpath.addAll(buildClasspath(coreClassloader));
- return classpath.toString();
+ // Determine Java version: When running under maven4 and a toolchain
+ // selects a jdk < 17, then we need to exclude "maven-logging-x.jar"
from the
+ // classpath. Otherwise slf4j's Logging Factory will try to initiale
Maven4's
Review Comment:
```suggestion
// classpath. Otherwise slf4j's Logging Factory will try to
initialize Maven4's
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]