{
mavenPluginManager.checkRequiredMavenVersion( mojoDescriptor.getPluginDescriptor() );
}
catch ( PluginIncompatibleException e )
{
throw new LifecycleExecutionException( mojoExecution, session.getCurrentProject(), e );
}
if ( mojoDescriptor.isProjectRequired() && !session.isUsingPOMsFromFilesystem() )
{
Throwable cause =
new MissingProjectException( "Goal requires a project to execute"
+ " but there is no POM in this directory (" + session.getExecutionRootDirectory() + ")."
+ " Please verify you invoked Maven from the correct directory." );
throw new LifecycleExecutionException( mojoExecution, null, cause );
}
if ( mojoDescriptor.isOnlineRequired() && session.isOffline() )
{
if ( MojoExecution.Source.CLI.equals( mojoExecution.getSource() ) )
{
Throwable cause =
new IllegalStateException( "Goal requires online mode for execution"
+ " but Maven is currently offline." );
throw new LifecycleExecutionException( mojoExecution, session.getCurrentProject(), cause );
}
else
{
eventCatapult.fire( ExecutionEvent.Type.MojoSkipped, session, mojoExecution );
return;
}
}
List<MavenProject> forkedProjects = executeForkedExecutions( mojoExecution, session, projectIndex );
ensureDependenciesAreResolved( mojoDescriptor, session, dependencyContext );
eventCatapult.fire( ExecutionEvent.Type.MojoStarted, session, mojoExecution );
try
{
try
{
pluginManager.executeMojo( session, mojoExecution );
}
catch ( MojoFailureException e )
{
throw new LifecycleExecutionException( mojoExecution, session.getCurrentProject(), e );
}
catch ( MojoExecutionException e )
{
throw new LifecycleExecutionException( mojoExecution, session.getCurrentProject(), e );
}
catch ( PluginConfigurationException e )
{
throw new LifecycleExecutionException( mojoExecution, session.getCurrentProject(), e );
}
catch ( PluginManagerException e )
{
throw new LifecycleExecutionException( mojoExecution, session.getCurrentProject(), e );
}
eventCatapult.fire( ExecutionEvent.Type.MojoSucceeded, session, mojoExecution );
}
catch ( LifecycleExecutionException e )