diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java index b97358dbaf..e4684d4d27 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java @@ -1351,15 +1351,15 @@ public class DefaultLifecycleExecutor throw new BuildFailureException( message ); } + // this has been simplified from the old code that injected the plugin management stuff, since + // pluginManagement injection is now handled by the project method. + project.addPlugin( plugin ); + if ( pluginDescriptor == null ) { pluginDescriptor = verifyPlugin( plugin, project, session.getSettings(), session.getLocalRepository() ); } - // this has been simplified from the old code that injected the plugin management stuff, since - // pluginManagement injection is now handled by the project method. - project.addPlugin( plugin ); - MojoDescriptor mojoDescriptor = pluginDescriptor.getMojo( goal ); if ( mojoDescriptor == null ) {