-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Classworld setup more alike to vanilla Maven #784
Conversation
client/src/main/java/org/mvndaemon/mvnd/client/DaemonConnector.java
Outdated
Show resolved
Hide resolved
common/src/main/java/org/mvndaemon/mvnd/common/MavenDaemon.java
Outdated
Show resolved
Hide resolved
FYI the builds are failing since bf892cd - Seems those artifacts aren't there yet. I'll rebase this branch on an earlier commit to get some CI feedback in the meantime. |
b5be6d5
to
364ef8f
Compare
364ef8f
to
5b45eee
Compare
@@ -473,6 +472,7 @@ DefaultPlexusContainer container() throws Exception { | |||
|
|||
List<File> extClassPath = Stream.of( | |||
Environment.MVND_EXT_CLASSPATH.asString().split(",")) | |||
.filter(s -> s != null && !s.isEmpty()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The missing empty filter here lead to the empty String being added to the extClassPath list, which made the classloader structure slightly different from vanilla Maven in some scenarios. Not a big deal in practice, but it broke some of our tests, so I decided to fix it for consistency :)
5b45eee
to
1678fcc
Compare
Use the plexus Launcher to start the daemon server, just like we would launch a normal Maven process. This improves compatbility with any extensions or plugins that assume that their ClassLoader is a ClassRealm.
1678fcc
to
a4a6f81
Compare
@gnodet this is ready for another look |
@oehme hi! Just passing by and wondering, in which case a plugin/extension would want to explicitly check for a class loader type? Did you think about this because of some real world use case? |
Yes, the Gradle Enterprise Maven extension does some "importRealm" magic, so that other extensions (written by customers) can access its API no matter how they were registered (ext/lib, maven.ext.classpath, .mvn/extensions.xml) |
Use the plexus Launcher to start the daemon server, just like we would
launch a normal Maven process.
This improves compatbility with any extensions or plugins that assume that
their ClassLoader is a ClassRealm.