mirror of https://github.com/apache/maven.git
o Fail properly when mojo requires project but there is none
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@808819 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6da9bf5c0a
commit
b2e6f787f6
|
@ -417,11 +417,17 @@ public class DefaultLifecycleExecutor
|
||||||
{
|
{
|
||||||
MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor();
|
MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor();
|
||||||
|
|
||||||
|
if ( mojoDescriptor.isProjectRequired() && !session.isUsingPOMsFromFilesystem() )
|
||||||
|
{
|
||||||
|
throw new MojoExecutionException( "Goal " + mojoDescriptor.getId()
|
||||||
|
+ " requires a project to execute but there is no POM in this build." );
|
||||||
|
}
|
||||||
|
|
||||||
if ( mojoDescriptor.isOnlineRequired() && session.isOffline() )
|
if ( mojoDescriptor.isOnlineRequired() && session.isOffline() )
|
||||||
{
|
{
|
||||||
if ( MojoExecution.Source.CLI.equals( mojoExecution.getSource() ) )
|
if ( MojoExecution.Source.CLI.equals( mojoExecution.getSource() ) )
|
||||||
{
|
{
|
||||||
throw new MojoExecutionException( "Goal " + mojoDescriptor.getGoal()
|
throw new MojoExecutionException( "Goal " + mojoDescriptor.getId()
|
||||||
+ " requires online mode for execution but Maven is currently offline." );
|
+ " requires online mode for execution but Maven is currently offline." );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue