Make sure mvnd's plexus-interactivity is not in the maven classloader, fixes #807

* the logging framework is extracted into its own jar and moved in the mvn/lib/ directory
* the other daemon jars are moved into the mvn/lib/mvnd directory and not used by maven at all
This makes maven class loader almost identical to the stock maven classloader, but for the logging framework
This commit is contained in:
Guillaume Nodet
2023-03-13 17:15:04 +01:00
parent 4d24010f55
commit 0e057cb12b
16 changed files with 83 additions and 30 deletions

View File

@@ -346,7 +346,7 @@ public class DaemonConnector {
String mvndAgentPath = null;
String plexusClassworldsPath = null;
try (DirectoryStream<Path> jarPaths = Files.newDirectoryStream(
mvndHome.resolve("mvn").resolve("lib").resolve("ext"))) {
mvndHome.resolve("mvn").resolve("lib").resolve("mvnd"))) {
for (Path jar : jarPaths) {
String s = jar.getFileName().toString();
if (s.endsWith(".jar")) {
@@ -368,7 +368,7 @@ public class DaemonConnector {
}
}
if (mvndAgentPath == null) {
throw new IllegalStateException("Could not find mvnd-agent jar in mvn/lib/ext/");
throw new IllegalStateException("Could not find mvnd-agent jar in mvn/lib/mvnd/");
}
if (plexusClassworldsPath == null) {
throw new IllegalStateException("Could not find plexus-classworlds jar in boot/");