-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #12000 - use URIUtil::toURI instead of URI::create in MavenWebA…
…ppContext
- Loading branch information
Showing
22 changed files
with
526 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
jetty-ee10/jetty-ee10-maven-plugin/src/it/jetty-start with spaces mojo-it/invoker.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
invoker.goals = test -e |
39 changes: 39 additions & 0 deletions
39
.../jetty-ee10-maven-plugin/src/it/jetty-start with spaces mojo-it/jetty-simple-base/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?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/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.eclipse.jetty.ee10.its.jetty-start-mojo-it</groupId> | ||
<artifactId>jetty-simple-project</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>jetty-simple-base</artifactId> | ||
<packaging>jar</packaging> | ||
|
||
<name>EE10 :: Simple :: Base</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>jakarta.servlet</groupId> | ||
<artifactId>jakarta.servlet-api</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>commons-io</groupId> | ||
<artifactId>commons-io</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.jetty.toolchain</groupId> | ||
<artifactId>jetty-perf-helper</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-databind</artifactId> | ||
</dependency> | ||
</dependencies> | ||
</project> |
38 changes: 38 additions & 0 deletions
38
...it/jetty-simple-base/src/main/java/org/eclipse/jetty/its/jetty_start_mojo_it/Counter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// ======================================================================== | ||
// Copyright (c) 1995 Mort Bay Consulting Pty Ltd and others. | ||
// | ||
// This program and the accompanying materials are made available under the | ||
// terms of the Eclipse Public License v. 2.0 which is available at | ||
// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | ||
// which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
// | ||
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | ||
// ======================================================================== | ||
// | ||
|
||
package org.eclipse.jetty.its.jetty_start_mojo_it; | ||
|
||
@SuppressWarnings("serial") | ||
public class Counter implements java.io.Serializable | ||
{ | ||
int counter = 0; | ||
String last; | ||
|
||
public int getCount() | ||
{ | ||
counter++; | ||
return counter; | ||
} | ||
|
||
public void setLast(String uri) | ||
{ | ||
last = uri; | ||
} | ||
|
||
public String getLast() | ||
{ | ||
return last; | ||
} | ||
} | ||
|
40 changes: 40 additions & 0 deletions
40
...tty-simple-base/src/main/java/org/eclipse/jetty/its/jetty_start_mojo_it/HelloServlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// | ||
// ======================================================================== | ||
// Copyright (c) 1995 Mort Bay Consulting Pty Ltd and others. | ||
// | ||
// This program and the accompanying materials are made available under the | ||
// terms of the Eclipse Public License v. 2.0 which is available at | ||
// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | ||
// which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
// | ||
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | ||
// ======================================================================== | ||
// | ||
|
||
package org.eclipse.jetty.its.jetty_start_mojo_it; | ||
|
||
import java.io.IOException; | ||
|
||
import jakarta.servlet.ServletException; | ||
import jakarta.servlet.annotation.WebServlet; | ||
import jakarta.servlet.http.HttpServlet; | ||
import jakarta.servlet.http.HttpServletRequest; | ||
import jakarta.servlet.http.HttpServletResponse; | ||
|
||
/** | ||
* | ||
*/ | ||
@WebServlet("/hello") | ||
public class HelloServlet | ||
extends HttpServlet | ||
{ | ||
|
||
@Override | ||
protected void doGet(HttpServletRequest req, HttpServletResponse resp) | ||
throws ServletException, IOException | ||
{ | ||
String who = req.getParameter("name"); | ||
|
||
resp.getWriter().write("Hello " + (who == null ? "unknown" : who)); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...etty-simple-base/src/main/java/org/eclipse/jetty/its/jetty_start_mojo_it/PingServlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// ======================================================================== | ||
// Copyright (c) 1995 Mort Bay Consulting Pty Ltd and others. | ||
// | ||
// This program and the accompanying materials are made available under the | ||
// terms of the Eclipse Public License v. 2.0 which is available at | ||
// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | ||
// which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
// | ||
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | ||
// ======================================================================== | ||
// | ||
|
||
package org.eclipse.jetty.its.jetty_start_mojo_it; | ||
|
||
import java.io.IOException; | ||
|
||
import jakarta.servlet.ServletException; | ||
import jakarta.servlet.http.HttpServlet; | ||
import jakarta.servlet.http.HttpServletRequest; | ||
import jakarta.servlet.http.HttpServletResponse; | ||
|
||
public class PingServlet | ||
extends HttpServlet | ||
{ | ||
|
||
@Override | ||
protected void doGet(HttpServletRequest req, HttpServletResponse resp) | ||
throws ServletException, IOException | ||
{ | ||
String who = req.getParameter("name"); | ||
|
||
resp.getWriter().write("pong " + (who == null ? "unknown" : who)); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...-start with spaces mojo-it/jetty-simple-base/src/main/resources/META-INF/web-fragment.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<web-fragment | ||
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-fragment_3_1.xsd" | ||
version="3.1"> | ||
|
||
<name>FragmentA</name> | ||
|
||
<ordering> | ||
<after><others/></after> | ||
</ordering> | ||
|
||
<servlet> | ||
<servlet-name>Ping</servlet-name> | ||
<servlet-class>org.eclipse.jetty.its.jetty_start_mojo_it.PingServlet</servlet-class> | ||
<init-param> | ||
<param-name>extra1</param-name><param-value>123</param-value> | ||
</init-param> | ||
<init-param> | ||
<param-name>extra2</param-name><param-value>345</param-value> | ||
</init-param> | ||
</servlet> | ||
|
||
<servlet-mapping> | ||
<servlet-name>Ping</servlet-name> | ||
<url-pattern>/ping</url-pattern> | ||
</servlet-mapping> | ||
|
||
|
||
</web-fragment> |
134 changes: 134 additions & 0 deletions
134
...etty-ee10-maven-plugin/src/it/jetty-start with spaces mojo-it/jetty-simple-webapp/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
<?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/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.eclipse.jetty.ee10.its.jetty-start-mojo-it</groupId> | ||
<artifactId>jetty-simple-project</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>jetty-simple-webapp</artifactId> | ||
<packaging>war</packaging> | ||
|
||
<name>EE10 :: Simple :: WebApp</name> | ||
|
||
<properties> | ||
<jetty.port.file>${project.build.directory}/jetty-start-port.txt</jetty.port.file> | ||
</properties> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>org.eclipse.jetty.ee10.its.jetty-start-mojo-it</groupId> | ||
<artifactId>jetty-simple-base</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.eclipse.jetty.ee10</groupId> | ||
<artifactId>jetty-ee10-servlet</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.eclipse.jetty.ee10</groupId> | ||
<artifactId>jetty-ee10-maven-plugin</artifactId> | ||
<classifier>tests</classifier> | ||
<type>test-jar</type> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-engine</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.jetty</groupId> | ||
<artifactId>jetty-client</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.awaitility</groupId> | ||
<artifactId>awaitility</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<build> | ||
|
||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<configuration> | ||
<failOnMissingWebXml>false</failOnMissingWebXml> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
<includes> | ||
<include>IntegrationTest*.java</include> | ||
</includes> | ||
<systemPropertyVariables> | ||
<jetty.port.file>${jetty.port.file}</jetty.port.file> | ||
<context.path>/setbycontextxml</context.path> | ||
<pingServlet>true</pingServlet> | ||
<helloServlet>true</helloServlet> | ||
<contentCheck>Counter accessed 1 times.</contentCheck> | ||
<pathToCheck>/jsp/bean1.jsp</pathToCheck> | ||
<maven.it.name>${project.groupId}:${project.artifactId}</maven.it.name> | ||
</systemPropertyVariables> | ||
<dependenciesToScan> | ||
<dependency>org.eclipse.jetty.ee10:jetty-ee10-maven-plugin</dependency> | ||
</dependenciesToScan> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.eclipse.jetty.ee10</groupId> | ||
<artifactId>jetty-ee10-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>start-jetty</id> | ||
<phase>test-compile</phase> | ||
<goals> | ||
<goal>start</goal> | ||
</goals> | ||
<configuration> | ||
<contextXml>${basedir}/src/config/context.xml</contextXml> | ||
<systemProperties> | ||
<jetty.port.file>${jetty.port.file}</jetty.port.file> | ||
<jetty.deployMode>EMBED</jetty.deployMode> | ||
</systemProperties> | ||
<jettyXmls> | ||
<jettyXml>${basedir}/src/config/jetty.xml</jettyXml> | ||
</jettyXmls> | ||
<loginServices> | ||
<loginService implementation="org.eclipse.jetty.security.HashLoginService"> | ||
<name>Test Realm</name> | ||
<config implementation="org.eclipse.jetty.maven.MavenResource"> | ||
<resourceAsString>${basedir}/src/config/realm.properties</resourceAsString> | ||
</config> | ||
</loginService> | ||
</loginServices> | ||
<webApp> | ||
<jettyEnvXml>${basedir}/src/config/jetty-env.xml</jettyEnvXml> | ||
<resourceBases> | ||
<resourceBase>${basedir}/src/main/webapp</resourceBase> | ||
</resourceBases> | ||
</webApp> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
7 changes: 7 additions & 0 deletions
7
...-plugin/src/it/jetty-start with spaces mojo-it/jetty-simple-webapp/src/config/context.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd"> | ||
|
||
<Configure class="org.eclipse.jetty.ee10.webapp.WebAppContext"> | ||
|
||
<Set name="contextPath">/setbycontextxml</Set> | ||
|
||
</Configure> |
12 changes: 12 additions & 0 deletions
12
...lugin/src/it/jetty-start with spaces mojo-it/jetty-simple-webapp/src/config/jetty-env.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0"?> | ||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://eclipse.dev/jetty/configure_10_0.dtd"> | ||
<Configure id='wac' class="org.eclipse.jetty.ee10.webapp.WebAppContext"> | ||
|
||
<!-- Add an EnvEntry only valid for this webapp --> | ||
<New id="foo" class="org.eclipse.jetty.plus.jndi.EnvEntry"> | ||
<Arg><Ref refid='wac'/></Arg> | ||
<Arg>fooBoolean</Arg> | ||
<Arg type="java.lang.Double">100</Arg> | ||
<Arg type="boolean">true</Arg> | ||
</New> | ||
</Configure> |
Oops, something went wrong.