Signed-off-by: Jan Bartel <janb@webtide.com>
This commit is contained in:
Jan Bartel 2019-09-18 10:21:47 +10:00
parent 995e0b6c59
commit ac48d3d32c
5 changed files with 17 additions and 15 deletions

View File

@ -109,13 +109,6 @@ public class JettyWebAppContext extends WebAppContext
super();
// Turn off copyWebInf option as it is not applicable for plugin.
super.setCopyWebInf(false);
addConfiguration(new MavenWebInfConfiguration());
addConfiguration(new MavenMetaInfConfiguration());
addConfiguration(new EnvConfiguration());
addConfiguration(new PlusConfiguration());
addConfiguration(new AnnotationConfiguration());
setAttribute(QuickStartConfiguration.ORIGIN_ATTRIBUTE, "origin");
}
public void setContainerIncludeJarPattern(String pattern)

View File

@ -24,6 +24,7 @@ import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
import org.eclipse.jetty.util.resource.Resource;
import org.eclipse.jetty.util.resource.ResourceCollection;
import org.eclipse.jetty.webapp.Configuration;
import org.eclipse.jetty.webapp.WebAppContext;
/**
@ -33,6 +34,12 @@ public class MavenQuickStartConfiguration extends QuickStartConfiguration
{
private static final Logger LOG = Log.getLogger(QuickStartConfiguration.class);
@Override
public Class<? extends Configuration> replaces()
{
return QuickStartConfiguration.class;
}
@Override
public void deconfigure(WebAppContext context) throws Exception
{

View File

@ -45,12 +45,12 @@ public class NewJettyEffectiveWebXml extends AbstractWebAppMojo
@Override
public void configureWebApp() throws Exception
{
//TODO consider if we want to be able to generate for the unassembled webapp: so that we could
//bind this into a build phase, and have it generate the quickstart
if (StringUtil.isBlank(webApp.getWar()))
throw new MojoExecutionException("No war specified");
//Use a nominated war file for which to generate the effective web.xml, or
//if that is not set, try to use the details of the current project's
//unassembled webapp
super.configureWebApp();
if (StringUtil.isBlank(webApp.getWar()))
configureUnassembledWebApp();
}
@Override

View File

@ -117,6 +117,7 @@ public class QuickStartGenerator
webApp.addConfiguration(new MavenQuickStartConfiguration());
webApp.setAttribute(QuickStartConfiguration.MODE, Mode.GENERATE);
webApp.setAttribute(QuickStartConfiguration.QUICKSTART_WEB_XML, Resource.newResource(quickstartXml));
webApp.setAttribute(QuickStartConfiguration.ORIGIN_ATTRIBUTE, "o");
webApp.setCopyWebDir(false);
webApp.setCopyWebInf(false);
}

View File

@ -1,2 +1,3 @@
org.eclipse.jetty.maven.plugin.MavenWebInfConfiguration
org.eclipse.jetty.maven.plugin.MavenMetaInfConfiguration
org.eclipse.jetty.maven.plugin.MavenQuickStartConfiguration