Merge branch 'jetty-10.0.x-5264-demo-modules' into jetty-10.0.x

This commit is contained in:
Joakim Erdfelt 2020-09-23 20:21:04 -05:00
commit ede63b0de2
No known key found for this signature in database
GPG Key ID: 2D0E1FB8FE4B68B4
252 changed files with 2353 additions and 1710 deletions

2
Jenkinsfile vendored
View File

@ -59,7 +59,7 @@ pipeline {
container( 'jetty-build' ) {
timeout( time: 30, unit: 'MINUTES' ) {
mavenBuild( "jdk11",
"package source:jar javadoc:jar javadoc:aggregate-jar -Peclipse-release -DskipTests -Dpmd.skip=true -Dcheckstyle.skip=true",
"package source:jar javadoc:jar -Peclipse-release -DskipTests -Dpmd.skip=true -Dcheckstyle.skip=true",
"maven3", true )
warnings consoleParsers: [[parserName: 'Maven'], [parserName: 'JavaDoc'], [parserName: 'Java']]
}

View File

@ -1,18 +1,17 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.eclipse.jetty</groupId>
<artifactId>example-async-rest</artifactId>
<groupId>org.eclipse.jetty.demos</groupId>
<artifactId>demo-async-rest-parent</artifactId>
<version>10.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.eclipse.jetty.example-async-rest</groupId>
<artifactId>example-async-rest-jar</artifactId>
<artifactId>demo-async-rest-jar</artifactId>
<packaging>jar</packaging>
<name>Example Async Rest :: Jar</name>
<name>Demo Async Rest :: Jar</name>
<properties>
<bundle-symbolic-name>${project.parent.groupId}.examples.async.rest</bundle-symbolic-name>
<bundle-symbolic-name>${project.parent.groupId}.async.rest</bundle-symbolic-name>
</properties>
<dependencies>

View File

@ -38,7 +38,6 @@ import org.eclipse.jetty.http.HttpMethod;
import org.eclipse.jetty.util.BufferUtil;
import org.eclipse.jetty.util.Utf8StringBuilder;
import org.eclipse.jetty.util.ajax.JSON;
import org.eclipse.jetty.util.ssl.SslContextFactory;
/**
* Servlet implementation class AsyncRESTServlet.

View File

@ -1,18 +1,17 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.eclipse.jetty</groupId>
<artifactId>example-async-rest</artifactId>
<groupId>org.eclipse.jetty.demos</groupId>
<artifactId>demo-async-rest-parent</artifactId>
<version>10.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.eclipse.jetty.example-async-rest</groupId>
<artifactId>example-async-rest-server</artifactId>
<artifactId>demo-async-rest-server</artifactId>
<packaging>jar</packaging>
<name>Example Async Rest :: Server</name>
<name>Demo Async Rest :: Server</name>
<properties>
<bundle-symbolic-name>${project.parent.groupId}.examples.async.rest.server</bundle-symbolic-name>
<bundle-symbolic-name>${project.parent.groupId}.async.rest.server</bundle-symbolic-name>
</properties>
<dependencies>

View File

@ -1,19 +1,14 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.eclipse.jetty</groupId>
<artifactId>example-async-rest</artifactId>
<groupId>org.eclipse.jetty.demos</groupId>
<artifactId>demo-async-rest-parent</artifactId>
<version>10.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.eclipse.jetty.example-async-rest</groupId>
<artifactId>example-async-rest-webapp</artifactId>
<artifactId>demo-async-rest-webapp</artifactId>
<packaging>war</packaging>
<name>Example Async Rest :: Webapp</name>
<build>
<finalName>async-rest</finalName>
</build>
<name>Demo Async Rest :: Webapp</name>
<dependencies>
<dependency>
@ -26,8 +21,8 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.example-async-rest</groupId>
<artifactId>example-async-rest-jar</artifactId>
<groupId>org.eclipse.jetty.demos</groupId>
<artifactId>demo-async-rest-jar</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>

View File

@ -0,0 +1,15 @@
# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html
[description]
Demo Async Rest webapp
[tags]
demo
webapp
[depends]
deploy
[files]
maven://org.eclipse.jetty.demos/demo-async-rest-webapp/${jetty.version}/war|webapps/demo-async-rest.war

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_9_3.dtd">
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
<!--
This is the jetty specific web application configuration file. When starting

View File

@ -1,20 +1,19 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.eclipse.jetty.examples</groupId>
<artifactId>examples-parent</artifactId>
<groupId>org.eclipse.jetty.demos</groupId>
<artifactId>demos-parent</artifactId>
<version>10.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>example-async-rest</artifactId>
<artifactId>demo-async-rest-parent</artifactId>
<packaging>pom</packaging>
<name>Example Async Rest</name>
<name>Demo Async Rest</name>
<modules>
<module>async-rest-jar</module>
<module>async-rest-webapp</module>
<module>async-rest-server</module>
<module>demo-async-rest-jar</module>
<module>demo-async-rest-webapp</module>
<module>demo-async-rest-server</module>
</modules>
</project>

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.jetty.demos</groupId>
<artifactId>demos-parent</artifactId>
<version>10.0.0-SNAPSHOT</version>
</parent>
<artifactId>demo-jaas-webapp</artifactId>
<name>Jetty Tests :: WebApp :: JAAS</name>
<packaging>war</packaging>
<properties>
<bundle-symbolic-name>${project.groupId}.jaas</bundle-symbolic-name>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<!-- DEMO Project, Must Deploy -->
<skip>false</skip>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${project.version}</version>
<configuration>
<scan>10</scan>
<systemProperties>
<!-- This is for convenience so that the src/etc/login.conf file can stay unmodified when copied to $jetty.home/etc directory -->
<jetty.base>${basedir}/src/main/config/demo-base</jetty.base>
<!-- Mandatory. This system property tells JAAS where to find the login module configuration file -->
<java.security.auth.login.config>${basedir}/src/main/config/demo-base/etc/login.conf</java.security.auth.login.config>
</systemProperties>
<webApp>
<contextPath>/test-jaas</contextPath>
<securityHandler implementation="org.eclipse.jetty.security.ConstraintSecurityHandler">
<loginService implementation="org.eclipse.jetty.jaas.JAASLoginService">
<name>Test JAAS Realm</name>
<loginModuleName>xyz</loginModuleName>
</loginService>
</securityHandler>
</webApp>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

View File

@ -0,0 +1,27 @@
# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html
[description]
Demo Spec webapp
[tags]
demo
webapp
[depends]
deploy
jaas
jdbc
jsp
annotations
ext
demo-realm
[files]
basehome:modules/demo.d/demo-jaas.xml|webapps/demo-jaas.xml
basehome:modules/demo.d/demo-login.conf|etc/demo-login.conf
basehome:modules/demo.d/demo-login.properties|etc/demo-login.properties
maven://org.eclipse.jetty.demos/demo-jaas-webapp/${jetty.version}/war|webapps/demo-jaas.war
[ini-template]
# Enable security via jaas, and configure it
jetty.jaas.login.conf=etc/demo-login.conf

View File

@ -2,19 +2,20 @@
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
<!-- =============================================================== -->
<!-- Configure the test-jaas webapp -->
<!-- Configure the demo-jaas webapp -->
<!-- =============================================================== -->
<Configure id='wac' class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/test-jaas</Set>
<Set name="war"><Property name="jetty.webapps" default="."/>/test-jaas.war</Set>
<Set name="war"><Property name="jetty.webapps" default="." />/demo-jaas.war
</Set>
<Set name="extractWAR">true</Set>
<Set name="securityHandler">
<New class="org.eclipse.jetty.security.ConstraintSecurityHandler">
<Set name="loginService">
<New class="org.eclipse.jetty.jaas.JAASLoginService">
<Set name="name">Test JAAS Realm</Set>
<Set name="name">Demo JAAS Realm</Set>
<Set name="loginModuleName">xyz</Set>
</New>
</Set>

View File

@ -1,5 +1,5 @@
xyz {
org.eclipse.jetty.jaas.spi.PropertyFileLoginModule required
debug="true"
file="${jetty.base}/etc/login.properties";
file="${jetty.base}/etc/demo-login.properties";
};

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_9_3.dtd">
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Get name="servletContext">

View File

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 71 KiB

View File

@ -17,11 +17,11 @@
<p>To enable JAAS in a base jetty instance do:
<pre>
$ cd $JETTY_BASE
$ java -jar $JETTY_HOME/start.jar --add-to-start=jaas
$ java -jar $JETTY_HOME/start.jar --add-module=jaas
</pre>
</p>
<p>This will create a $JETTY_BASE/start.d/jaas.ini file to enable and parameterize JAAS. If no start.d directory exists, then the same initialisation will be appended to the
$JETTY_BASE/start.ini file. The Jetty demo-base already has JAAS enabled in its start.ini file. </p>
<p>This will create a $JETTY_BASE/start.d/jaas.ini file to enable and parameterize JAAS.
The Jetty demo-base already has JAAS enabled by the demo-jaas module. </p>
<p>The full source of this demonstration is available <a
href="https://github.com/eclipse/jetty.project/blob/master/tests/test-webapps/test-jaas-webapp">here</a>.</p>

View File

@ -1,19 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.eclipse.jetty.tests</groupId>
<artifactId>test-webapps-parent</artifactId>
<groupId>org.eclipse.jetty.demos</groupId>
<artifactId>demos-parent</artifactId>
<version>10.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>test-jetty-webapp</artifactId>
<name>Test :: Jetty Test Webapp</name>
<artifactId>demo-jetty-webapp</artifactId>
<name>Demo :: Jetty Test Webapp</name>
<url>http://www.eclipse.org/jetty</url>
<packaging>war</packaging>
<properties>
<bundle-symbolic-name>${project.groupId}.tests.webapp</bundle-symbolic-name>
<bundle-symbolic-name>${project.groupId}.webapp</bundle-symbolic-name>
</properties>
<build>
<plugins>
@ -38,14 +37,12 @@
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>web-bundle-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptorRefs>
<descriptorRef>config</descriptorRef>
</descriptorRefs>
<descriptors>
<descriptor>src/main/assembly/web-bundle.xml</descriptor>
</descriptors>
@ -88,49 +85,6 @@
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${project.version}</version>
<dependencies>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlets</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<configuration>
<stopPort>8087</stopPort>
<stopKey>foo</stopKey>
<scan>1</scan>
<systemProperties>
<fooprop>222</fooprop>
</systemProperties>
<webApp>
<contextPath>/test</contextPath>
<tempDirectory>${project.build.directory}/work</tempDirectory>
</webApp>
<loginServices>
<loginService implementation="org.eclipse.jetty.security.HashLoginService">
<name>Test Realm</name>
<config>src/main/config/demo-base/etc/realm.properties</config>
</loginService>
</loginServices>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<!-- must deploy: required for jetty-distribution -->
<skip>false</skip>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_9_3.dtd">
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
<!-- ==================================================================
Configure and deploy the test web application in $(jetty.home)/webapps/test

View File

@ -0,0 +1,26 @@
# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html
[description]
Demo Jetty Webapp
[tags]
demo
webapp
[depends]
deploy
jdbc
jsp
jstl
annotations
ext
servlets
websocket-javax
websocket-jetty
demo-realm
[files]
webapps/demo-jetty.d/
basehome:modules/demo.d/demo-jetty.xml|webapps/demo-jetty.xml
basehome:modules/demo.d/demo-jetty-override-web.xml|webapps/demo-jetty.d/demo-jetty-override-web.xml
maven://org.eclipse.jetty.demos/demo-jetty-webapp/${jetty.version}/war|webapps/demo-jetty.war

View File

@ -0,0 +1,14 @@
# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html
[description]
Demonstrate a Moved Context Handler.
[tags]
demo
[depends]
deploy
[files]
basehome:modules/demo.d/demo-moved-context.xml|webapps/demo-moved-context.xml

View File

@ -0,0 +1,17 @@
# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html
[description]
Demonstrate the rewrite module.
[tags]
demo
[depends]
rewrite
[xml]
etc/demo-rewrite-rules.xml
[files]
basehome:modules/demo.d/demo-rewrite-rules.xml|etc/demo-rewrite-rules.xml

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
<!-- ==================================================================
Configure and deploy the test web application
===================================================================== -->
<Configure id="testWebapp" class="org.eclipse.jetty.webapp.WebAppContext">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Required minimal context configuration : -->
<!-- + contextPath -->
<!-- + war OR resourceBase -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<Set name="contextPath">/test</Set>
<Set name="war"><Property name="jetty.webapps" default="." />/demo-jetty.war
</Set>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Optional context configuration -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<Set name="extractWAR">true</Set>
<Set name="copyWebDir">false</Set>
<Set name="defaultsDescriptor"><Property name="jetty.home" default="."/>/etc/webdefault.xml</Set>
<Set name="overrideDescriptor"><Property name="jetty.webapps" default="." />/demo-jetty.d/demo-jetty-override-web.xml
</Set>
<!-- Enable WebSocket container -->
<Call name="setAttribute">
<Arg>org.eclipse.jetty.websocket.javax</Arg>
<Arg type="Boolean">true</Arg>
</Call>
<Call name="insertHandler">
<Arg>
<New class="org.eclipse.jetty.server.handler.gzip.GzipHandler">
<Set name="minGzipSize">2048</Set>
</New>
</Arg>
</Call>
</Configure>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_9_3.dtd">
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
<!-- Simple handler to redirect from old path to new -->
<Configure class="org.eclipse.jetty.server.handler.MovedContextHandler">

View File

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<!-- This web.xml format file is an override file that is applied to the test webapp AFTER
it has been configured by the default descriptor and the WEB-INF/web.xml descriptor -->
<!-- Add or override context init parameter -->
<context-param>
<param-name>context-override-example</param-name>
<param-value>a context value</param-value>
</context-param>
<!-- Add or override servlet init parameter -->
<servlet>
<servlet-name>default</servlet-name>
<init-param>
<param-name>precompressed</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<!-- Add or override servlet init parameter -->
<servlet>
<servlet-name>Dump</servlet-name>
<init-param>
<param-name>servlet-override-example</param-name>
<param-value>a servlet value</param-value>
</init-param>
</servlet>
<!-- Add servlet mapping -->
<servlet-mapping>
<servlet-name>Dump</servlet-name>
<url-pattern>*.more</url-pattern>
</servlet-mapping>
<!-- Reset servlet class and/or start order -->
<servlet>
<servlet-name>Session</servlet-name>
<servlet-class>com.acme.SessionDump</servlet-class>
<load-on-startup>5</load-on-startup>
</servlet>
<!-- Allow remote access to test webapp -->
<!--
<filter>
<filter-name>TestFilter</filter-name>
<filter-class>com.acme.TestFilter</filter-class>
<async-supported>true</async-supported>
<init-param>
<param-name>remote</param-name>
<param-value>true</param-value>
</init-param>
</filter>
-->
</web-app>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_9_3.dtd">
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
<!--
This is the jetty specific web application configuration file. When starting

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 71 KiB

Some files were not shown because too many files have changed in this diff Show More