gnodet opened a new pull request, #13477: URL: https://github.com/apache/maven/pull/13477
Backport of #13312 to `maven-4.0.x`. Cherry-pick of f215871e7baffcd2091a5be430cf79d60fe04956, applied cleanly with no conflicts. `setupPluginRealm` restored the class realm and artifacts from `PluginRealmCache` on a cache hit but not the resolver dependency node. A second execution of a plugin therefore left `PluginDescriptor.getDependencyNode()` null, causing `MojoExecution.getPlugin().getDependencies()` to throw a `NullPointerException`. - `PluginRealmCache.CacheRecord` now carries the `DependencyNode`; 3-arg constructor and `getDependencyNode()` accessor added (2-arg preserved for compatibility) - `DefaultMavenPluginManager.setupPluginRealm` stores the node in the `CacheRecord` on cache miss and restores it on cache hit - `PluginRealmCache` SPI: the default `get(Key, PluginRealmSupplier)` was calling `put(key, realm, artifacts)`, silently dropping the node for custom implementations; fixed to return the supplier's record directly via a new 4-arg `put()` default method - `DefaultPluginRealmCache` overrides 4-arg `put()` to store the full record - Test: `DefaultMavenPluginManagerRealmCacheTest` verifies the node is restored on cache hit and the resolver is invoked exactly once Fixes #13307 -- 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]
