{
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;
}
}
lifeCycleDependencyResolver.checkForUpdate( session, dependencyContext );
List<MavenProject> forkedProjects =
executeForkedExecutions( mojoExecution, session, projectIndex, dependencyContext );
eventCatapult.fire( ExecutionEvent.Type.MojoStarted, session, mojoExecution );
ArtifactFilter artifactFilter = getArtifactFilter( mojoDescriptor );
List<MavenProject> resolvedProjects =
LifecycleDependencyResolver.getProjects( session.getCurrentProject(), session,
mojoDescriptor.isAggregator() );
for ( MavenProject project : resolvedProjects )
{
project.setArtifactFilter( artifactFilter );
}
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 )