You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MojoExecution.getPlugin().getDependencies() throws NPE when the plugin realm is cached #13307
MojoExecution.getPlugin().getDependencies() (and getDependenciesMap()) throws a NullPointerException from the second execution of a plugin in a build.
Cause: getDependenciesMap() in DefaultMojoExecution wraps PluginDescriptor.getDependencyNode() in a DefaultNode without a null check. The node is set only in DefaultMavenPluginManager.createPluginRealm. When the realm comes from PluginRealmCache, DefaultMavenPluginManager.setupPluginRealm restores the class realm and the artifacts from the CacheRecord but not the dependency node, because CacheRecord holds only those two. The PluginDescriptor constructor that takes a Maven 4 descriptor also sets it to null (// TODO: v4).
Found by the multiple-phase-test IT of the Maven 4 API port of maven-antrun-plugin (#13302), which binds the same plugin twice. Keeping the dependency node in CacheRecord and restoring it with the realm should fix it.
Activity
Fix cached plugin dependency lookup (apache#13307)
fix: restore DependencyNode from PluginRealmCache on cache hit
fix: restore DependencyNode from PluginRealmCache on cache hit
fix: restore DependencyNode from PluginRealmCache on cache hit