andrey-petrenko-db commented on a change in pull request #607:
URL: https://github.com/apache/maven/pull/607#discussion_r751591392
##########
File path:
maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java
##########
@@ -492,6 +492,21 @@ private void discoverPluginComponents( final ClassRealm
pluginRealm, Plugin plug
ClassRealm pluginRealm = pluginDescriptor.getClassRealm();
+ if ( pluginRealm == null )
+ {
+ try
+ {
+ setupPluginRealm( pluginDescriptor, session, null, null, null
);
+ }
+ catch ( PluginResolutionException e )
+ {
+ String msg = "Cannot setup plugin realm [mojoDescriptor=" +
mojoDescriptor.getId()
+ + ", pluginDescriptor=" + pluginDescriptor.getId() +
"]";
+ throw new PluginConfigurationException( pluginDescriptor, msg,
e );
+ }
+ pluginRealm = pluginDescriptor.getClassRealm();
+ }
+
if ( logger.isDebugEnabled() )
Review comment:
> @maximilian-novikov-db any idea why this snippet came through ? Is
that actually a needed change in `maven-core` ?
Because there is no any sense to call this method when pluginRealm is not
set in plugin descriptor
this code is guaranteed to fail with a NPE in that case
I've raised PR https://github.com/apache/maven/pull/612 to this branch
please take a look how this method is used in CachingMojosExecutionStrategy
This allows us to get rid of MojoChecker and related functionality
--
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]