mirror of
https://github.com/apache/maven.git
synced 2025-03-06 08:39:31 +00:00
[MNG-4291] [regression] @requiresOnline mojo annotation is ignored
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@803141 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c0f98e60b2
commit
16b9331f92
@ -257,6 +257,23 @@ else if ( MavenExecutionRequest.REACTOR_FAIL_FAST.equals( session.getReactorFail
|
||||
private void execute( MavenProject project, MavenSession session, MojoExecution mojoExecution )
|
||||
throws MojoFailureException, MojoExecutionException, PluginConfigurationException, PluginManagerException
|
||||
{
|
||||
MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor();
|
||||
|
||||
if ( mojoDescriptor.isOnlineRequired() && session.isOffline() )
|
||||
{
|
||||
if ( MojoExecution.Source.CLI.equals( mojoExecution.getSource() ) )
|
||||
{
|
||||
throw new MojoExecutionException( "Goal " + mojoDescriptor.getGoal()
|
||||
+ " requires online mode for execution but Maven is currently offline." );
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.warn( "Goal " + mojoDescriptor.getGoal()
|
||||
+ " requires online mode for execution but Maven is currently offline, skipping" );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
MavenProject executionProject = null;
|
||||
|
||||
List<MojoExecution> forkedExecutions = mojoExecution.getForkedExecutions();
|
||||
@ -265,7 +282,7 @@ private void execute( MavenProject project, MavenSession session, MojoExecution
|
||||
{
|
||||
if ( logger.isDebugEnabled() )
|
||||
{
|
||||
logger.debug( "Forking execution for " + mojoExecution.getMojoDescriptor().getId() );
|
||||
logger.debug( "Forking execution for " + mojoDescriptor.getId() );
|
||||
}
|
||||
|
||||
executionProject = project.clone();
|
||||
@ -285,7 +302,7 @@ private void execute( MavenProject project, MavenSession session, MojoExecution
|
||||
|
||||
if ( logger.isDebugEnabled() )
|
||||
{
|
||||
logger.debug( "Completed forked execution for " + mojoExecution.getMojoDescriptor().getId() );
|
||||
logger.debug( "Completed forked execution for " + mojoDescriptor.getId() );
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user