parent
881f17c6be
commit
456e467bcb
|
@ -14,9 +14,11 @@
|
||||||
<name>Jetty :: Simple :: Webapp</name>
|
<name>Jetty :: Simple :: Webapp</name>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<jetty.port.file>${project.build.directory}/jetty-start-war-distro-port.txt</jetty.port.file>
|
<jetty.port.file>${project.build.directory}/jetty-start-distro-port.txt</jetty.port.file>
|
||||||
|
<jetty.jvmArgs>@jetty.jvmArgs@</jetty.jvmArgs>
|
||||||
<jetty.runType>DISTRO</jetty.runType>
|
<jetty.runType>DISTRO</jetty.runType>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty.its.jetty-start-war-distro-mojo-it</groupId>
|
<groupId>org.eclipse.jetty.its.jetty-start-war-distro-mojo-it</groupId>
|
||||||
|
@ -106,14 +108,16 @@
|
||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<webApp>
|
<webApp>
|
||||||
<war>${project.build.directory}/${project.artifactId}-${project.version}</war>
|
<!-- starts the assembled webapp by default -->
|
||||||
</webApp>
|
</webApp>
|
||||||
|
<jettyBase>${basedir}/src/base</jettyBase>
|
||||||
|
<javaPath>${java.home}/bin/java</javaPath>
|
||||||
<jettyProperties>
|
<jettyProperties>
|
||||||
|
<jetty.server.dumpAfterStart>true</jetty.server.dumpAfterStart>
|
||||||
<jetty.port.file>${jetty.port.file}</jetty.port.file>
|
<jetty.port.file>${jetty.port.file}</jetty.port.file>
|
||||||
|
<jetty.http.port>0</jetty.http.port>
|
||||||
</jettyProperties>
|
</jettyProperties>
|
||||||
<jettyXmls>
|
<modules>jsp,jstl,testmod</modules>
|
||||||
<jettyXml>${basedir}/src/config/jetty.xml</jettyXml>
|
|
||||||
</jettyXmls>
|
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_9_3.dtd">
|
||||||
|
|
||||||
|
<Configure id="Server" class="org.eclipse.jetty.server.Server">
|
||||||
|
<Ref id="httpConnector">
|
||||||
|
<Call name="addLifeCycleListener">
|
||||||
|
<Arg>
|
||||||
|
<New class="org.eclipse.jetty.maven.plugin.ServerConnectorListener">
|
||||||
|
<Set name="fileName"><Property name="jetty.port.file" default="port.txt"/></Set>
|
||||||
|
</New>
|
||||||
|
</Arg>
|
||||||
|
</Call>
|
||||||
|
</Ref>
|
||||||
|
</Configure>
|
|
@ -0,0 +1,12 @@
|
||||||
|
DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html
|
||||||
|
|
||||||
|
[description]
|
||||||
|
Enables test setup
|
||||||
|
|
||||||
|
[depend]
|
||||||
|
http
|
||||||
|
|
||||||
|
|
||||||
|
[xml]
|
||||||
|
etc/test-jetty.xml
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
<?xml version="1.0"?>
|
|
||||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
|
|
||||||
|
|
||||||
<Configure id="Server" class="org.eclipse.jetty.server.Server">
|
|
||||||
<New id="httpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
|
|
||||||
<Set name="secureScheme">https</Set>
|
|
||||||
<Set name="securePort"><Property name="jetty.secure.port" default="8443" /></Set>
|
|
||||||
<Set name="outputBufferSize">32768</Set>
|
|
||||||
<Set name="requestHeaderSize">8192</Set>
|
|
||||||
<Set name="responseHeaderSize">8192</Set>
|
|
||||||
<Set name="headerCacheSize">4096</Set>
|
|
||||||
</New>
|
|
||||||
|
|
||||||
<Call name="addConnector">
|
|
||||||
<Arg>
|
|
||||||
<New class="org.eclipse.jetty.server.ServerConnector">
|
|
||||||
<Arg name="server"><Ref refid="Server" /></Arg>
|
|
||||||
<Arg name="factories">
|
|
||||||
<Array type="org.eclipse.jetty.server.ConnectionFactory">
|
|
||||||
<Item>
|
|
||||||
<New class="org.eclipse.jetty.server.HttpConnectionFactory">
|
|
||||||
<Arg name="config"><Ref refid="httpConfig" /></Arg>
|
|
||||||
</New>
|
|
||||||
</Item>
|
|
||||||
</Array>
|
|
||||||
</Arg>
|
|
||||||
<Call name="addLifeCycleListener">
|
|
||||||
<Arg>
|
|
||||||
<New class="org.eclipse.jetty.maven.plugin.ServerConnectorListener">
|
|
||||||
<Set name="fileName"><Property name="jetty.port.file" default="port.txt"/></Set>
|
|
||||||
</New>
|
|
||||||
</Arg>
|
|
||||||
</Call>
|
|
||||||
<Set name="host" property="jetty.host"/>
|
|
||||||
<Set name="port" property="jetty.port"/>
|
|
||||||
<Set name="idleTimeout">30000</Set>
|
|
||||||
</New>
|
|
||||||
</Arg>
|
|
||||||
</Call>
|
|
||||||
</Configure>
|
|
|
@ -193,7 +193,7 @@ public abstract class AbstractWebAppMojo extends AbstractMojo
|
||||||
/**
|
/**
|
||||||
* Root directory for all html/jsp etc files
|
* Root directory for all html/jsp etc files
|
||||||
*/
|
*/
|
||||||
@Parameter (defaultValue="${maven.war.src}")
|
@Parameter (defaultValue="${project.baseDir}/src/main/webapp")
|
||||||
protected File webAppSourceDirectory;
|
protected File webAppSourceDirectory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -219,8 +219,8 @@ public abstract class AbstractWebAppMojo extends AbstractMojo
|
||||||
* The default location of the web.xml file. Will be used
|
* The default location of the web.xml file. Will be used
|
||||||
* if <webApp><descriptor> is not set.
|
* if <webApp><descriptor> is not set.
|
||||||
*/
|
*/
|
||||||
@Parameter (defaultValue="${maven.war.webxml}", readonly=true)
|
@Parameter (defaultValue="${project.baseDir}/src/main/webapp/WEB-INF/web.xml")
|
||||||
protected String webXml;
|
protected File webXml;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The target directory
|
* The target directory
|
||||||
|
@ -1137,7 +1137,6 @@ public abstract class AbstractWebAppMojo extends AbstractMojo
|
||||||
//the former could be the location of a packed war, while the latter is the location
|
//the former could be the location of a packed war, while the latter is the location
|
||||||
//after any unpacking. With this mojo, you are running an unpacked, unassembled webapp,
|
//after any unpacking. With this mojo, you are running an unpacked, unassembled webapp,
|
||||||
//so the two locations should be equal.
|
//so the two locations should be equal.
|
||||||
System.err.println("SRC WEBAPP: "+webAppSourceDirectory);
|
|
||||||
Resource webAppSourceDirectoryResource = Resource.newResource(webAppSourceDirectory.getCanonicalPath());
|
Resource webAppSourceDirectoryResource = Resource.newResource(webAppSourceDirectory.getCanonicalPath());
|
||||||
if (webApp.getWar() == null)
|
if (webApp.getWar() == null)
|
||||||
webApp.setWar(webAppSourceDirectoryResource.toString());
|
webApp.setWar(webAppSourceDirectoryResource.toString());
|
||||||
|
|
|
@ -37,7 +37,7 @@ import org.apache.maven.plugins.annotations.ResolutionScope;
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Mojo( name = "newstart", requiresDependencyResolution = ResolutionScope.TEST)
|
@Mojo(name = "newstart", requiresDependencyResolution = ResolutionScope.TEST)
|
||||||
@Execute(phase = LifecyclePhase.VALIDATE)
|
@Execute(phase = LifecyclePhase.VALIDATE)
|
||||||
public class NewJettyStartMojo extends AbstractWebAppMojo
|
public class NewJettyStartMojo extends AbstractWebAppMojo
|
||||||
{
|
{
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
package org.eclipse.jetty.maven.plugin;
|
package org.eclipse.jetty.maven.plugin;
|
||||||
|
|
||||||
import org.apache.maven.plugin.MojoExecutionException;
|
import org.apache.maven.plugin.MojoExecutionException;
|
||||||
|
import org.apache.maven.plugins.annotations.Execute;
|
||||||
|
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||||
import org.apache.maven.plugins.annotations.Mojo;
|
import org.apache.maven.plugins.annotations.Mojo;
|
||||||
import org.apache.maven.plugins.annotations.ResolutionScope;
|
import org.apache.maven.plugins.annotations.ResolutionScope;
|
||||||
import org.eclipse.jetty.util.StringUtil;
|
import org.eclipse.jetty.util.StringUtil;
|
||||||
|
@ -57,7 +59,10 @@ public class NewJettyStartWarMojo extends AbstractWebAppMojo
|
||||||
{
|
{
|
||||||
super.configureWebApp();
|
super.configureWebApp();
|
||||||
if (StringUtil.isBlank(webApp.getWar()))
|
if (StringUtil.isBlank(webApp.getWar()))
|
||||||
|
{
|
||||||
|
super.verifyPomConfiguration();
|
||||||
configureUnassembledWebApp();
|
configureUnassembledWebApp();
|
||||||
|
}
|
||||||
|
|
||||||
getLog().info("War = "+webApp.getWar());
|
getLog().info("War = "+webApp.getWar());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue