Issue #2209 Require war packaging only for some jetty maven plugin goals.
Signed-off-by: Jan Bartel <janb@webtide.com>
This commit is contained in:
parent
1e76caf00d
commit
85ed19ce3f
|
@ -293,8 +293,9 @@ public abstract class AbstractJettyMojo extends AbstractMojo
|
|||
public abstract void restartWebApp(boolean reconfigureScanner) throws Exception;
|
||||
|
||||
|
||||
public abstract void checkPomConfiguration() throws MojoExecutionException;
|
||||
public abstract void checkPomConfiguration() throws MojoExecutionException;
|
||||
|
||||
public abstract void checkPackagingConfiguration() throws MojoExecutionException;
|
||||
|
||||
public abstract void configureScanner () throws MojoExecutionException;
|
||||
|
||||
|
@ -323,11 +324,15 @@ public abstract class AbstractJettyMojo extends AbstractMojo
|
|||
|
||||
configurePluginClasspath();
|
||||
PluginLog.setLog(getLog());
|
||||
checkPomConfiguration();
|
||||
checkConfiguration();
|
||||
startJetty();
|
||||
}
|
||||
|
||||
|
||||
public void checkConfiguration() throws MojoExecutionException
|
||||
{
|
||||
checkPackagingConfiguration();
|
||||
checkPomConfiguration();
|
||||
}
|
||||
|
||||
|
||||
public void configurePluginClasspath() throws MojoExecutionException
|
||||
|
|
|
@ -67,6 +67,23 @@ public class JettyDeployWar extends JettyRunWarMojo
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jetty.maven.plugin.JettyRunWarMojo#checkPackagingConfiguration()
|
||||
*/
|
||||
@Override
|
||||
public void checkPackagingConfiguration() throws MojoExecutionException
|
||||
{
|
||||
return; //do not require this to be a war project
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void finishConfigurationBeforeStart() throws Exception
|
||||
{
|
||||
|
|
|
@ -175,17 +175,25 @@ public class JettyRunMojo extends AbstractJettyMojo
|
|||
@Override
|
||||
public void execute() throws MojoExecutionException, MojoFailureException
|
||||
{
|
||||
if ( !"war".equals( project.getPackaging() ) || skip )
|
||||
{
|
||||
return;
|
||||
}
|
||||
warPluginInfo = new WarPluginInfo(project);
|
||||
super.execute();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jetty.maven.plugin.AbstractJettyMojo#checkPackagingConfiguration()
|
||||
*/
|
||||
@Override
|
||||
public void checkPackagingConfiguration() throws MojoExecutionException
|
||||
{
|
||||
if ( !"war".equals( project.getPackaging() ))
|
||||
throw new MojoExecutionException("Not war packaging");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Verify the configuration given in the pom.
|
||||
*
|
||||
|
|
|
@ -79,6 +79,17 @@ public class JettyRunWarExplodedMojo extends AbstractJettyMojo
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jetty.maven.plugin.AbstractJettyMojo#checkPackagingConfiguration()
|
||||
*/
|
||||
@Override
|
||||
public void checkPackagingConfiguration() throws MojoExecutionException
|
||||
{
|
||||
if ( !"war".equals( project.getPackaging() ))
|
||||
throw new MojoExecutionException("Not war packaging");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @see AbstractJettyMojo#checkPomConfiguration()
|
||||
|
|
|
@ -61,10 +61,6 @@ public class JettyRunWarMojo extends AbstractJettyMojo
|
|||
*/
|
||||
public void execute() throws MojoExecutionException, MojoFailureException
|
||||
{
|
||||
if ( !"war".equals( project.getPackaging() ) || skip )
|
||||
{
|
||||
return;
|
||||
}
|
||||
super.execute();
|
||||
}
|
||||
|
||||
|
@ -96,7 +92,18 @@ public class JettyRunWarMojo extends AbstractJettyMojo
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jetty.maven.plugin.AbstractJettyMojo#checkPackagingConfiguration()
|
||||
*/
|
||||
@Override
|
||||
public void checkPackagingConfiguration() throws MojoExecutionException
|
||||
{
|
||||
if ( !"war".equals( project.getPackaging() ))
|
||||
throw new MojoExecutionException("Not war packaging");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -48,7 +48,15 @@ public class JettyStartMojo extends JettyRunMojo
|
|||
super.execute();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jetty.maven.plugin.AbstractJettyMojo#checkPackagingConfiguration()
|
||||
*/
|
||||
@Override
|
||||
public void checkPackagingConfiguration() throws MojoExecutionException
|
||||
{
|
||||
return; //don't check that the project is a war
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishConfigurationBeforeStart() throws Exception
|
||||
{
|
||||
|
|
|
@ -62,9 +62,7 @@ public class JettyStopMojo extends AbstractMojo
|
|||
* @parameter
|
||||
*/
|
||||
protected int stopWait;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue