[MNG-6619] Core extensions should not be in plexus.core classloader
- Dominant language
- Java
- Stars
- 5.3k
- Forks
- 3.1k
- Avg merge
- 20h 42m
- Merged PRs (30d)
- 297
Description
**[Stefan Oehme](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=oehme)** opened **[MNG-6619](https://issues.apache.org/jira/browse/MNG-6619?redirect=false)** and commented
The core extensions classloader is set up in [MavenCli](https://github.com/apache/maven/blob/b7249aff22b8993ddecfed26003c2e1bc04e708c/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java#L788).
However, [this line](https://github.com/apache/maven/blob/0be26449fb96774be126a6ad245d1a98dc71907c/apache-maven/src/bin/m2.conf#L7) also loads them into the plexus.core classloader, which is really just supposed to contain the Maven core jars.
This can lead to problems when event spies are added to `lib/ext`. They are instantiated and get events when resolving other extensions during the `loadCoreExtensions` method, even though they have not yet been initialized.
I assume that the line in m2.conf is just outdated and superseded by `loadCoreExtensions` and should thus be removed to avoid non-initialized event spies being called while loading extensions.
---
0 votes, 6 watchers
Contributor guide
Assessment
This issue has not been assessed yet.