Commit 2f63a4e
[MNG-8572] Fix @PreDestroy ClassNotFoundException caused by premature ClassRealm disposal
The Plexus Disposable.dispose() lifecycle runs before Sisu's @PreDestroy
callbacks. When dispose() called flush(), it disposed ClassRealms before
@PreDestroy methods on beans loaded from those realms could execute,
causing ClassNotFoundException.
Change dispose() to only clear the cache map without disposing realms.
The flush() method (used for explicit cache clearing between builds)
remains unchanged. ClassRealms are disposed when the PlexusContainer
shuts down after all lifecycle callbacks complete.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 29b3efb commit 2f63a4e
3 files changed
Lines changed: 3 additions & 3 deletions
File tree
- impl/maven-core/src/main/java/org/apache/maven
- plugin
- project
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
| 218 | + | |
219 | 219 | | |
220 | 220 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
0 commit comments