diff --git a/Jenkinsfile b/Jenkinsfile index 34229e2bea0e..f955ab5909d7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -69,6 +69,19 @@ pipeline { } } } + stage("Module : /jetty-ee8/") { + steps { + container('jetty-build') { + timeout(time: 120, unit: 'MINUTES') { + dir("${env.WORKSPACE}/buildy") { + //cleanup all projects + mavenBuild("jdk17", "clean -T4", "maven3") + mavenBuild("jdk17", "clean install -f jetty-ee8", "maven3") + } + } + } + } + } stage("Module : /jetty-ee10/") { steps { container('jetty-build') { diff --git a/jetty-ee10/jetty-ee10-annotations/src/main/config/modules/ee10-annotations.mod b/jetty-ee10/jetty-ee10-annotations/src/main/config/modules/ee10-annotations.mod index ca8274bd10e6..076c431b366a 100644 --- a/jetty-ee10/jetty-ee10-annotations/src/main/config/modules/ee10-annotations.mod +++ b/jetty-ee10/jetty-ee10-annotations/src/main/config/modules/ee10-annotations.mod @@ -10,7 +10,6 @@ ee10 ee10-plus [lib] -lib/jetty-ee10-annotations-${jetty.version}.jar lib/ee10-annotations/*.jar [jpms] diff --git a/jetty-ee10/jetty-ee10-jaas/pom.xml b/jetty-ee10/jetty-ee10-jaas/pom.xml index e3e1e60280d1..d9fb5935ce15 100644 --- a/jetty-ee10/jetty-ee10-jaas/pom.xml +++ b/jetty-ee10/jetty-ee10-jaas/pom.xml @@ -31,6 +31,7 @@ false false + --add-opens java.base/sun.security.x509=ALL-UNNAMED --add-opens java.base/sun.security.util=ALL-UNNAMED @@ -141,29 +142,6 @@ ${junit.version} test - - - - jdk16 - - [16,) - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - --add-opens java.base/sun.security.x509=ALL-UNNAMED --add-opens java.base/sun.security.util=ALL-UNNAMED - - - - - - - - diff --git a/jetty-ee8/jetty-ee8-annotations/pom.xml b/jetty-ee8/jetty-ee8-annotations/pom.xml new file mode 100644 index 000000000000..9defa5644bdf --- /dev/null +++ b/jetty-ee8/jetty-ee8-annotations/pom.xml @@ -0,0 +1,124 @@ + + + org.eclipse.jetty.ee8 + jetty-ee8 + 12.0.0-SNAPSHOT + + + 4.0.0 + jetty-ee8-annotations + EE8 :: Jetty :: Servlet Annotations + Annotation support for deploying servlets in jetty. + + jetty-ee9-annotations + ${project.groupId}.annotations + org.eclipse.annotations.* + + + + + + src/test/jar + jar + + + + + maven-surefire-plugin + + + @{argLine} ${jetty.surefire.argLine} --add-reads org.eclipse.jetty.ee8.annotations=org.eclipse.jetty.logging --add-opens org.eclipse.jetty.ee8.annotations/org.eclipse.jetty.ee8.annotations.resources=org.eclipse.jetty.ee8.plus + + + + + + org.apache.maven.plugins + maven-resources-plugin + + + copy-ee8-test-resources + generate-test-resources + + copy-resources + + + ${project.build.testOutputDirectory} + + + ${maven.multiModuleProjectDirectory}/jetty-ee9/${ee9.module}/src/test/resources + + + + + + + + org.apache.felix + maven-bundle-plugin + true + + + ${osgi.slf4j.import.packages},org.objectweb.asm;version="[$(version;==;${asm.version}),$(version;+;${asm.version}))",* + osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)", osgi.serviceloader; filter:="(osgi.serviceloader=jakarta.servlet.ServletContainerInitializer)";resolution:=optional;cardinality:=multiple, osgi.extender; filter:="(osgi.extender=osgi.serviceloader.processor)";resolution:=optional + + + osgi.serviceloader; osgi.serviceloader=org.eclipse.jetty.ee8.webapp.Configuration + + + + + + + + + + org.eclipse.jetty.ee8 + jetty-ee8-plus + + + org.eclipse.jetty.ee8 + jetty-ee8-webapp + + + jakarta.annotation + jakarta.annotation-api + + + org.ow2.asm + asm + + + org.ow2.asm + asm-commons + + + org.slf4j + slf4j-api + + + org.eclipse.jetty.toolchain + jetty-servlet-api + + + jakarta.transaction + jakarta.transaction-api + test + + + org.eclipse.jetty.toolchain + jetty-test-helper + test + + + org.eclipse.jetty + jetty-jndi + test + + + org.eclipse.jetty + jetty-slf4j-impl + test + + + diff --git a/jetty-ee8/jetty-ee8-annotations/src/main/config/modules/annotations.mod b/jetty-ee8/jetty-ee8-annotations/src/main/config/modules/annotations.mod new file mode 100644 index 000000000000..519131a07d76 --- /dev/null +++ b/jetty-ee8/jetty-ee8-annotations/src/main/config/modules/annotations.mod @@ -0,0 +1,15 @@ +# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + +[description] +Enables Annotation scanning for deployed web applications. + +[depend] +plus + +[lib] +lib/jetty-ee8-annotations-${jetty.version}.jar +lib/annotations/*.jar + +[jpms] +add-modules:org.objectweb.asm + diff --git a/jetty-ee8/jetty-ee8-annotations/src/test/jar/test-sci-for-container-path.jar b/jetty-ee8/jetty-ee8-annotations/src/test/jar/test-sci-for-container-path.jar new file mode 100644 index 000000000000..d6fa63a78d67 Binary files /dev/null and b/jetty-ee8/jetty-ee8-annotations/src/test/jar/test-sci-for-container-path.jar differ diff --git a/jetty-ee8/jetty-ee8-annotations/src/test/jar/test-sci-for-webinf.jar b/jetty-ee8/jetty-ee8-annotations/src/test/jar/test-sci-for-webinf.jar new file mode 100644 index 000000000000..dd90bda8494a Binary files /dev/null and b/jetty-ee8/jetty-ee8-annotations/src/test/jar/test-sci-for-webinf.jar differ diff --git a/jetty-ee8/jetty-ee8-annotations/src/test/jar/test-sci-with-ordering.jar b/jetty-ee8/jetty-ee8-annotations/src/test/jar/test-sci-with-ordering.jar new file mode 100644 index 000000000000..18e0a15593bc Binary files /dev/null and b/jetty-ee8/jetty-ee8-annotations/src/test/jar/test-sci-with-ordering.jar differ diff --git a/jetty-ee8/jetty-ee8-annotations/src/test/jar/test-sci.jar b/jetty-ee8/jetty-ee8-annotations/src/test/jar/test-sci.jar new file mode 100644 index 000000000000..bb9b90654bbc Binary files /dev/null and b/jetty-ee8/jetty-ee8-annotations/src/test/jar/test-sci.jar differ diff --git a/jetty-ee8/jetty-ee8-jaas/pom.xml b/jetty-ee8/jetty-ee8-jaas/pom.xml new file mode 100644 index 000000000000..4a637a083f69 --- /dev/null +++ b/jetty-ee8/jetty-ee8-jaas/pom.xml @@ -0,0 +1,150 @@ + + + org.eclipse.jetty.ee8 + jetty-ee8 + 12.0.0-SNAPSHOT + + + 4.0.0 + jetty-ee8-jaas + EE8 :: Jetty :: JAAS + Jetty JAAS support + + + jetty-ee9-jaas + ${project.groupId}.jaas + 2.0.0.AM26 + 2.1.0 + org.eclipse.jetty.jaas.* + + + + + + + org.apache.maven.plugins + maven-source-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + false + false + --add-opens java.base/sun.security.x509=ALL-UNNAMED --add-opens java.base/sun.security.util=ALL-UNNAMED + + + + + + + + org.eclipse.jetty.ee8 + jetty-ee8-security + + + org.slf4j + slf4j-api + + + org.eclipse.jetty + jetty-slf4j-impl + test + + + org.eclipse.jetty.toolchain + jetty-test-helper + test + + + org.apache.directory.server + apacheds-test-framework + ${apacheds.version} + test + + + junit + junit + + + + org.apache.directory.shared + shared-ldap-schema + + + org.apache.directory.api + api-ldap-schema-data + + + + + org.apache.directory.server + apacheds-server-integ + ${apacheds.version} + test + + + + org.apache.directory.shared + shared-ldap-schema + + + org.apache.directory.api + api-ldap-schema-data + + + + + org.apache.directory.server + apacheds-core-integ + ${apacheds.version} + test + + + + org.apache.directory.shared + shared-ldap-schema + + + org.apache.directory.api + api-ldap-schema-data + + + + + org.apache.directory.api + api-ldap-schema-data + ${apache.directory.api.version} + test + + + org.apache.directory.api + api-ldap-model + ${apache.directory.api.version} + + + org.apache.directory.api + api-util + ${apache.directory.api.version} + + + org.apache.directory.api + api-asn1-api + ${apache.directory.api.version} + + + + org.junit.vintage + junit-vintage-engine + ${junit.version} + test + + + + + + diff --git a/jetty-ee8/jetty-ee8-jaas/src/main/config/etc/jetty-jaas.xml b/jetty-ee8/jetty-ee8-jaas/src/main/config/etc/jetty-jaas.xml new file mode 100644 index 000000000000..881b23292a05 --- /dev/null +++ b/jetty-ee8/jetty-ee8-jaas/src/main/config/etc/jetty-jaas.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + java.security.auth.login.config + + + + + + + + + diff --git a/jetty-ee8/jetty-ee8-jaas/src/main/config/modules/jaas.mod b/jetty-ee8/jetty-ee8-jaas/src/main/config/modules/jaas.mod new file mode 100644 index 000000000000..bc90bb02cc94 --- /dev/null +++ b/jetty-ee8/jetty-ee8-jaas/src/main/config/modules/jaas.mod @@ -0,0 +1,18 @@ +# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + +[description] +Enables JAAS for deployed web applications. + +[depend] +server + +[lib] +lib/jetty-ee8-jaas-${jetty.version}.jar + +[xml] +etc/jetty-jaas.xml + +[ini-template] +## The file location (relative to $jetty.base) for the +## JAAS "java.security.auth.login.config" system property +# jetty.jaas.login.conf=etc/login.conf diff --git a/jetty-ee8/jetty-ee8-nested/pom.xml b/jetty-ee8/jetty-ee8-nested/pom.xml new file mode 100644 index 000000000000..43e213ff98ff --- /dev/null +++ b/jetty-ee8/jetty-ee8-nested/pom.xml @@ -0,0 +1,91 @@ + + + org.eclipse.jetty.ee8 + jetty-ee8 + 12.0.0-SNAPSHOT + + + 4.0.0 + jetty-ee8-nested + EE8 :: Jetty :: Nested + The jetty core handler adapted to legacy ee8 handler. + + + jetty-ee9-nested + ${project.groupId}.server + org.eclipse.jetty.server.* + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + @{argLine} ${jetty.surefire.argLine} --add-reads org.eclipse.jetty.ee8.nested=org.eclipse.jetty.logging --add-opens org.eclipse.jetty.server/org.eclipse.jetty.server=ALL-UNNAMED + + + + + + + + + org.eclipse.jetty.toolchain + jetty-servlet-api + + + org.eclipse.jetty + jetty-http + + + org.eclipse.jetty + jetty-io + + + org.eclipse.jetty + jetty-server + + + org.eclipse.jetty + jetty-jmx + true + + + org.slf4j + slf4j-api + + + org.eclipse.jetty + jetty-xml + test + + + org.eclipse.jetty.toolchain + jetty-test-helper + test + + + org.eclipse.jetty + jetty-http-tools + test + + + org.eclipse.jetty + jetty-util-ajax + test + + + org.eclipse.jetty + jetty-slf4j-impl + test + + + org.eclipse.jetty + jetty-session + compile + + + + diff --git a/jetty-ee8/jetty-ee8-nested/src/main/assembly/site-component.xml b/jetty-ee8/jetty-ee8-nested/src/main/assembly/site-component.xml new file mode 100644 index 000000000000..575269c1a1e8 --- /dev/null +++ b/jetty-ee8/jetty-ee8-nested/src/main/assembly/site-component.xml @@ -0,0 +1,15 @@ + + site-component + + jar + + + + ${basedir} + jetty + + src/main/resources/org/eclipse/** + + + + diff --git a/jetty-ee8/jetty-ee8-plus/pom.xml b/jetty-ee8/jetty-ee8-plus/pom.xml new file mode 100644 index 000000000000..daa74c8bc492 --- /dev/null +++ b/jetty-ee8/jetty-ee8-plus/pom.xml @@ -0,0 +1,69 @@ + + + org.eclipse.jetty.ee8 + jetty-ee8 + 12.0.0-SNAPSHOT + + + 4.0.0 + jetty-ee8-plus + EE8 :: Jetty :: Plus + Jetty JavaEE style services + + + jetty-ee9-plus + ${project.groupId}.plus + org.eclipse.jetty.plus.* + + + + + + org.apache.felix + maven-bundle-plugin + true + + + ${osgi.slf4j.import.packages},jakarta.transaction.*;version="2.0.0",* + + osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)" + + + osgi.serviceloader; osgi.serviceloader=org.eclipse.jetty.ee8.webapp.Configuration + + + + + + + + + + jakarta.transaction + jakarta.transaction-api + + + org.eclipse.jetty + jetty-jndi + + + org.eclipse.jetty.ee8 + jetty-ee8-webapp + + + org.slf4j + slf4j-api + + + org.eclipse.jetty + jetty-slf4j-impl + test + + + org.eclipse.jetty.toolchain + jetty-test-helper + test + + + + diff --git a/jetty-ee8/jetty-ee8-plus/src/main/config/etc/jetty-plus.xml b/jetty-ee8/jetty-ee8-plus/src/main/config/etc/jetty-plus.xml new file mode 100644 index 000000000000..ae50d8cd359c --- /dev/null +++ b/jetty-ee8/jetty-ee8-plus/src/main/config/etc/jetty-plus.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + org.eclipse.jetty.ee8.plus.webapp.EnvConfiguration + org.eclipse.jetty.ee8.plus.webapp.PlusConfiguration + + + + + + + + + + + diff --git a/jetty-ee8/jetty-ee8-plus/src/main/config/modules/plus.mod b/jetty-ee8/jetty-ee8-plus/src/main/config/modules/plus.mod new file mode 100644 index 000000000000..fe622e67ffd2 --- /dev/null +++ b/jetty-ee8/jetty-ee8-plus/src/main/config/modules/plus.mod @@ -0,0 +1,12 @@ +[description] +Enables Servlet 3.1 resource injection. + +[depend] +server +security +jndi +webapp + +[lib] +lib/jetty-ee8-plus-${jetty.version}.jar +lib/jakarta.transaction-api-*.jar diff --git a/jetty-ee8/jetty-ee8-security/pom.xml b/jetty-ee8/jetty-ee8-security/pom.xml new file mode 100644 index 000000000000..ef1f0ed7aacd --- /dev/null +++ b/jetty-ee8/jetty-ee8-security/pom.xml @@ -0,0 +1,61 @@ + + + org.eclipse.jetty.ee8 + jetty-ee8 + 12.0.0-SNAPSHOT + + + 4.0.0 + jetty-ee8-security + EE8 :: Jetty :: Security + Jetty security infrastructure + + + jetty-ee9-security + ${project.groupId}.security + org.eclipse.jetty.security.* + + + + + + org.apache.felix + maven-bundle-plugin + true + + + osgi.serviceloader; filter:="(osgi.serviceloader=org.eclipse.jetty.security.Authenticator$Factory)";resolution:=optional;cardinality:=multiple, osgi.extender; filter:="(osgi.extender=osgi.serviceloader.processor)";resolution:=optional + + + + + + + + + org.eclipse.jetty.ee8 + jetty-ee8-nested + + + org.slf4j + slf4j-api + + + + org.eclipse.jetty + jetty-slf4j-impl + test + + + org.eclipse.jetty + jetty-http-tools + test + + + org.eclipse.jetty.toolchain + jetty-test-helper + test + + + + diff --git a/jetty-ee8/jetty-ee8-security/src/main/config/modules/ee8-security.mod b/jetty-ee8/jetty-ee8-security/src/main/config/modules/ee8-security.mod new file mode 100644 index 000000000000..eb8b958ded72 --- /dev/null +++ b/jetty-ee8/jetty-ee8-security/src/main/config/modules/ee8-security.mod @@ -0,0 +1,13 @@ +# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + +[description] +Adds servlet standard security handling to the classpath. + +[environment] +ee8 + +[depend] +server + +[lib] +lib/jetty-ee8-security-${jetty.version}.jar diff --git a/jetty-ee8/jetty-ee8-servlet/pom.xml b/jetty-ee8/jetty-ee8-servlet/pom.xml new file mode 100644 index 000000000000..7099dafd9e8a --- /dev/null +++ b/jetty-ee8/jetty-ee8-servlet/pom.xml @@ -0,0 +1,81 @@ + + + + org.eclipse.jetty.ee8 + jetty-ee8 + 12.0.0-SNAPSHOT + + + 4.0.0 + jetty-ee8-servlet + EE8 :: Jetty :: Servlet Handling + Jetty Servlet Container + + + jetty-ee9-servlet + ${project.groupId}.servlet + org.eclipse.jetty.* + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + @{argLine} ${jetty.surefire.argLine} + --add-modules org.eclipse.jetty.util.ajax + --add-reads org.eclipse.jetty.ee8.servlet=org.eclipse.jetty.logging + + + + + + + + + org.eclipse.jetty.ee8 + jetty-ee8-nested + + + org.eclipse.jetty.ee8 + jetty-ee8-security + + + org.slf4j + slf4j-api + + + org.eclipse.jetty + jetty-util-ajax + true + + + org.eclipse.jetty + jetty-jmx + true + + + + org.eclipse.jetty + jetty-slf4j-impl + test + + + org.eclipse.jetty.toolchain + jetty-test-helper + test + + + org.eclipse.jetty + jetty-http-tools + test + + + org.eclipse.jetty + jetty-client + test + + + diff --git a/jetty-ee8/jetty-ee8-servlet/src/main/config/modules/ee8-servlet.mod b/jetty-ee8/jetty-ee8-servlet/src/main/config/modules/ee8-servlet.mod new file mode 100644 index 000000000000..ee47a3e2b6b4 --- /dev/null +++ b/jetty-ee8/jetty-ee8-servlet/src/main/config/modules/ee8-servlet.mod @@ -0,0 +1,17 @@ +# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + +[description] +Enables standard Servlet handling. + +[environment] +ee8 + +[depend] +server +sessions + +# FIXME should servlet api version be interpolated +[lib] +lib/jetty-jakarta-servlet-api-4.0.4.jar +lib/jetty-ee8-nested-${jetty.version}.jar +lib/jetty-ee8-servlet-${jetty.version}.jar diff --git a/jetty-ee8/jetty-ee8-servlets/pom.xml b/jetty-ee8/jetty-ee8-servlets/pom.xml new file mode 100644 index 000000000000..ff785f54a84c --- /dev/null +++ b/jetty-ee8/jetty-ee8-servlets/pom.xml @@ -0,0 +1,87 @@ + + + + org.eclipse.jetty.ee8 + jetty-ee8 + 12.0.0-SNAPSHOT + + + 4.0.0 + jetty-ee8-servlets + EE8 :: Jetty :: Utility Servlets and Filters + Jetty Utility Servlets + + + jetty-ee9-servlets + ${project.groupId}.servlets + org.eclipse.jetty.ee8.servlets.* + + + + + + maven-surefire-plugin + + + @{argLine} ${jetty.surefire.argLine} --add-modules jetty.servlet.api --add-modules org.eclipse.jetty.util --add-modules org.eclipse.jetty.io --add-modules org.eclipse.jetty.http --add-modules org.eclipse.jetty.server --add-modules org.eclipse.jetty.session --add-modules org.eclipse.jetty.ee8.nested --add-reads org.eclipse.jetty.ee8.servlets=java.management --add-reads org.eclipse.jetty.ee8.servlets=org.eclipse.jetty.jmx --add-reads org.eclipse.jetty.ee8.servlets=org.eclipse.jetty.logging + + + + + + + + + org.eclipse.jetty + jetty-http + + + org.eclipse.jetty.ee8 + jetty-ee8-nested + provided + + + org.eclipse.jetty.ee8 + jetty-ee8-webapp + provided + + + org.eclipse.jetty + jetty-util + + + org.eclipse.jetty.toolchain + jetty-servlet-api + provided + + + org.eclipse.jetty + jetty-io + + + org.slf4j + slf4j-api + + + org.eclipse.jetty + jetty-slf4j-impl + test + + + org.eclipse.jetty + jetty-jmx + test + + + org.eclipse.jetty + jetty-http-tools + test + + + org.eclipse.jetty.toolchain + jetty-test-helper + test + + + + diff --git a/jetty-ee8/jetty-ee8-servlets/src/main/config/modules/servlets.mod b/jetty-ee8/jetty-ee8-servlets/src/main/config/modules/servlets.mod new file mode 100644 index 000000000000..83c25a10195d --- /dev/null +++ b/jetty-ee8/jetty-ee8-servlets/src/main/config/modules/servlets.mod @@ -0,0 +1,13 @@ +# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + +[description] +Adds Jetty utility servlets and filters available to a webapp. +Puts org.eclipse.jetty.ee8.servlets on the server classpath (CGI, CrossOriginFilter, DosFilter, +MultiPartFilter, PushCacheFilter, QoSFilter, etc.) for use by all webapplications. + +[depend] +servlet + +[lib] +lib/jetty-ee8-servlets-${jetty.version}.jar + diff --git a/jetty-ee8/jetty-ee8-webapp/pom.xml b/jetty-ee8/jetty-ee8-webapp/pom.xml new file mode 100644 index 000000000000..5b1e898c869b --- /dev/null +++ b/jetty-ee8/jetty-ee8-webapp/pom.xml @@ -0,0 +1,142 @@ + + + org.eclipse.jetty.ee8 + jetty-ee8 + 12.0.0-SNAPSHOT + + + 4.0.0 + jetty-ee8-webapp + EE8 :: Jetty :: Webapp Application Support + Jetty web application support + + + jetty-ee9-webapp + ${project.groupId}.webapp + org.eclipse.jetty.ee8.webapp.* + + + + + + + org.apache.maven.plugins + maven-resources-plugin + + + copy-ee8-resources + generate-resources + + copy-resources + + + ${project.build.outputDirectory} + + + ${maven.multiModuleProjectDirectory}/jetty-ee9/jetty-ee9-webapp/src/main/resources + + + src/main/config/etc + org/eclipse/jetty/ee8/webapp + false + + webdefault-ee8.xml + + + + + + + copy-ee8-test-resources + generate-test-resources + + copy-resources + + + ${project.build.testOutputDirectory} + + + ${maven.multiModuleProjectDirectory}/jetty-ee9/jetty-ee9-webapp/src/test/resources + + + ${maven.multiModuleProjectDirectory}/jetty-ee9/jetty-ee9-webapp/src/test/webapp + webapp + + + ${maven.multiModuleProjectDirectory}/jetty-ee9/jetty-ee9-webapp/src/test/webapp-alt-jsp + webapp-alt-jsp + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + @{argLine} ${jetty.surefire.argLine} + + false + + ${basedir}/src/test/resources/module/foo-bar-janb.jar + + + org.eclipse.jetty.ee8.webapp.WebAppClassLoaderUrlStreamTest + + + + + org.apache.felix + maven-bundle-plugin + true + + + + osgi.extender; filter:="(osgi.extender=osgi.serviceloader.processor)", osgi.serviceloader; filter:="(osgi.serviceloader=org.eclipse.jetty.ee8.webapp.Configuration)";cardinality:=multiple, osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)" + + + osgi.serviceloader; osgi.serviceloader=org.eclipse.jetty.ee8.webapp.Configuration + + + + + + + + + + org.eclipse.jetty.ee8 + jetty-ee8-servlet + + + org.eclipse.jetty + jetty-xml + + + org.slf4j + slf4j-api + + + org.eclipse.jetty + jetty-slf4j-impl + test + + + org.eclipse.jetty + jetty-http-tools + test + + + org.eclipse.jetty.toolchain + jetty-test-helper + test + + + org.eclipse.jetty + jetty-client + test + + + diff --git a/jetty-ee8/jetty-ee8-webapp/src/main/config/etc/jetty-ee8-deploy.xml b/jetty-ee8/jetty-ee8-webapp/src/main/config/etc/jetty-ee8-deploy.xml new file mode 100644 index 000000000000..17302e00b0e4 --- /dev/null +++ b/jetty-ee8/jetty-ee8-webapp/src/main/config/etc/jetty-ee8-deploy.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + org.eclipse.jetty.deploy.DeploymentManager + + + + contextHandlerClass + + + + + + + + ee8 + + + + + + + + + + + + + jetty.deploy.defaultsDescriptorPath + + /etc/webdefault-ee8.xml + + + + + + + + + + + + + + + + + + + + diff --git a/jetty-ee8/jetty-ee8-webapp/src/main/config/etc/jetty-ee8-webapp.xml b/jetty-ee8/jetty-ee8-webapp/src/main/config/etc/jetty-ee8-webapp.xml new file mode 100644 index 000000000000..2bfa7239f9b2 --- /dev/null +++ b/jetty-ee8/jetty-ee8-webapp/src/main/config/etc/jetty-ee8-webapp.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jetty-ee8/jetty-ee8-webapp/src/main/config/etc/webdefault-ee8.xml b/jetty-ee8/jetty-ee8-webapp/src/main/config/etc/webdefault-ee8.xml new file mode 100644 index 000000000000..694dca9635fc --- /dev/null +++ b/jetty-ee8/jetty-ee8-webapp/src/main/config/etc/webdefault-ee8.xml @@ -0,0 +1,443 @@ + + + + + + + + + + + + + + + + + + + + + + + Default web.xml file. + This file is applied to a Web application before its own WEB_INF/web.xml file + + + + + + + + org.eclipse.jetty.ee8.servlet.listener.ELContextCleaner + + + + + + + + org.eclipse.jetty.ee8.servlet.listener.IntrospectorCleaner + + + + + + + + + + + + + + + + + default + org.eclipse.jetty.ee8.servlet.DefaultServlet + + acceptRanges + true + + + dirAllowed + true + + + welcomeServlets + false + + + redirectWelcome + false + + + maxCacheSize + 256000000 + + + maxCachedFileSize + 200000000 + + + maxCachedFiles + 2048 + + + etags + false + + + useFileMappedBuffer + true + + 0 + + + + default + / + + + + + + + + + + + + + + + jsp + org.eclipse.jetty.jsp.JettyJspServlet + + xpoweredBy + false + + + compilerTargetVM + 1.8 + + + compilerSourceVM + 1.8 + + 0 + + + + jsp + *.jsp + *.jspf + *.jspx + *.xsp + *.JSP + *.JSPF + *.JSPX + *.XSP + + + + + + + + 30 + + + + + + + + + + + + + + + index.html + index.htm + index.jsp + + + + + + + + ar + ISO-8859-6 + + + be + ISO-8859-5 + + + bg + ISO-8859-5 + + + ca + ISO-8859-1 + + + cs + ISO-8859-2 + + + da + ISO-8859-1 + + + de + ISO-8859-1 + + + el + ISO-8859-7 + + + en + ISO-8859-1 + + + es + ISO-8859-1 + + + et + ISO-8859-1 + + + fi + ISO-8859-1 + + + fr + ISO-8859-1 + + + hr + ISO-8859-2 + + + hu + ISO-8859-2 + + + is + ISO-8859-1 + + + it + ISO-8859-1 + + + iw + ISO-8859-8 + + + ja + Shift_JIS + + + ko + EUC-KR + + + lt + ISO-8859-2 + + + lv + ISO-8859-2 + + + mk + ISO-8859-5 + + + nl + ISO-8859-1 + + + no + ISO-8859-1 + + + pl + ISO-8859-2 + + + pt + ISO-8859-1 + + + ro + ISO-8859-2 + + + ru + ISO-8859-5 + + + sh + ISO-8859-5 + + + sk + ISO-8859-2 + + + sl + ISO-8859-2 + + + sq + ISO-8859-2 + + + sr + ISO-8859-5 + + + sv + ISO-8859-1 + + + tr + ISO-8859-9 + + + uk + ISO-8859-5 + + + zh + GB2312 + + + zh_TW + Big5 + + + + + + + + + Disable TRACE + / + TRACE + + + + + + Enable everything but TRACE + / + TRACE + + + + + diff --git a/jetty-ee8/jetty-ee8-webapp/src/main/config/modules/ee8-deploy.mod b/jetty-ee8/jetty-ee8-webapp/src/main/config/modules/ee8-deploy.mod new file mode 100644 index 000000000000..35387c15f137 --- /dev/null +++ b/jetty-ee8/jetty-ee8-webapp/src/main/config/modules/ee8-deploy.mod @@ -0,0 +1,33 @@ +[description] +Enables web application deployment from the $JETTY_BASE/webapps/ directory. + +[environment] +ee8 + +[depend] +deploy +ee8-webapp + +[lib] + +[files] +webapps-ee8/ + +[xml] +etc/jetty-ee8-deploy.xml + +[ini-template] +# Monitored directory name (relative to $jetty.base) +# jetty.deploy.monitoredDir=webapps-ee8 +# - OR - +# Monitored directory path (fully qualified) +# jetty.deploy.monitoredPath=/var/www/webapps-ee8 + +# Defaults Descriptor for all deployed webapps +# jetty.deploy.defaultsDescriptorPath=${jetty.base}/etc/webdefault-ee8.xml + +# Monitored directory scan period (seconds) +# jetty.deploy.scanInterval=1 + +# Whether to extract *.war files +# jetty.deploy.extractWars=true diff --git a/jetty-ee8/jetty-ee8-webapp/src/main/config/modules/ee8-webapp.mod b/jetty-ee8/jetty-ee8-webapp/src/main/config/modules/ee8-webapp.mod new file mode 100644 index 000000000000..7577807e784f --- /dev/null +++ b/jetty-ee8/jetty-ee8-webapp/src/main/config/modules/ee8-webapp.mod @@ -0,0 +1,39 @@ +# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + +[description] +Adds support for servlet specification web applications to the server classpath. +Without this, only Jetty-specific handlers may be deployed. + +[environment] +ee8 + +[depend] +ee8-servlet +ee8-security + +[xml] +etc/jetty-ee8-webapp.xml + +[lib] +lib/jetty-ee8-webapp-${jetty.version}.jar + + +[ini-template] +## Add to the server wide default jars and packages protected or hidden from webapps. +## System classes are protected and cannot be overridden by a webapp. +## Server classes are hidden and cannot be seen by a webapp +## Lists of patterns are comma separated and may be either: +## + a qualified classname e.g. 'com.acme.Foo' +## + a package name e.g. 'net.example.' +## + a jar file e.g. '${jetty.base.uri}/lib/dependency.jar' +## + a directory of jars,resource or classes e.g. '${jetty.base.uri}/resources' +## + A pattern preceded with a '-' is an exclusion, all other patterns are inclusions +## +## The +=, operator appends to a CSV list with a comma as needed. +## +#jetty.webapp.addSystemClasses+=,org.example. +#jetty.webapp.addServerClasses+=,org.example. +contextHandlerClass = org.eclipse.jetty.ee8.webapp.WebAppContext + +[jpms] +add-modules:java.instrument diff --git a/jetty-ee8/pom.xml b/jetty-ee8/pom.xml new file mode 100644 index 000000000000..f049c0dccfd4 --- /dev/null +++ b/jetty-ee8/pom.xml @@ -0,0 +1,175 @@ + + + + org.eclipse.jetty + jetty-project + 12.0.0-SNAPSHOT + + + 4.0.0 + org.eclipse.jetty.ee8 + jetty-ee8 + EE8 :: Parent + pom + + + 4.0.6 + 4.0.4 + 1.3.3 + 1.3.5 + + true + true + + + + + jetty-ee8-nested + jetty-ee8-security + jetty-ee8-servlet + jetty-ee8-servlets + jetty-ee8-webapp + jetty-ee8-jaas + jetty-ee8-plus + jetty-ee8-annotations + + + + ${project.build.directory}/generated-sources/ee8 + ${project.build.directory}/generated-test-sources/ee8 + + + + org.eclipse.jetty.toolchain + jetty-modify-sources-maven-plugin + 1.0.0-SNAPSHOT + + + + + + org.apache.maven.plugins + maven-resources-plugin + + + copy-ee8-resources + generate-resources + + copy-resources + + + ${project.build.outputDirectory} + + + ${maven.multiModuleProjectDirectory}/jetty-ee9/${ee9.module}/src/main/resources + + + + + + copy-ee8-test-resources + generate-test-resources + + copy-resources + + + ${project.build.testOutputDirectory} + + + ${maven.multiModuleProjectDirectory}/jetty-ee9/${ee9.module}/src/test/resources + + + + + + + + org.eclipse.jetty.toolchain + jetty-modify-sources-maven-plugin + + + generate-ee8-sources + generate-sources + + modify-sources-ee9-to-ee8 + + + ${maven.multiModuleProjectDirectory}/jetty-ee9/${ee9.module}/src/main/java + ${project.build.sourceDirectory} + + + + generate-ee8-test-sources + generate-test-sources + + modify-sources-ee9-to-ee8 + + + true + ${maven.multiModuleProjectDirectory}/jetty-ee9/${ee9.module}/src/test/java + ${project.build.testSourceDirectory} + + + + + + + + + + + + + jakarta.servlet + jakarta.servlet-api + ${jakarta.servlet.api.version} + + + jakarta.transaction + jakarta.transaction-api + ${jakarta.transaction-api.version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta.annotation.api.version} + + + org.eclipse.jetty.toolchain + jetty-servlet-api + ${jetty.servlet.api.version} + + + org.eclipse.jetty.ee8 + jetty-ee8-nested + ${project.version} + + + org.eclipse.jetty.ee8 + jetty-ee8-security + ${project.version} + + + org.eclipse.jetty.ee8 + jetty-ee8-servlet + ${project.version} + + + org.eclipse.jetty.ee8 + jetty-ee8-webapp + ${project.version} + + + org.eclipse.jetty.ee8 + jetty-ee8-servlets + ${project.version} + + + org.eclipse.jetty.ee8 + jetty-ee8-plus + ${project.version} + + + + + diff --git a/jetty-ee9/jetty-ee9-annotations/pom.xml b/jetty-ee9/jetty-ee9-annotations/pom.xml index 32b489515bd8..e2d3c93b6880 100644 --- a/jetty-ee9/jetty-ee9-annotations/pom.xml +++ b/jetty-ee9/jetty-ee9-annotations/pom.xml @@ -15,6 +15,15 @@ + + + src/test/resources + + + src/test/jar + jar + + maven-surefire-plugin diff --git a/jetty-ee9/jetty-ee9-annotations/src/main/config/modules/annotations.mod b/jetty-ee9/jetty-ee9-annotations/src/main/config/modules/annotations.mod index ec6a976386de..54a5db69611b 100644 --- a/jetty-ee9/jetty-ee9-annotations/src/main/config/modules/annotations.mod +++ b/jetty-ee9/jetty-ee9-annotations/src/main/config/modules/annotations.mod @@ -7,7 +7,7 @@ Enables Annotation scanning for deployed web applications. plus [lib] -lib/jetty-annotations-${jetty.version}.jar +lib/jetty-ee9-annotations-${jetty.version}.jar lib/annotations/*.jar [jpms] diff --git a/jetty-ee9/jetty-ee9-annotations/src/test/java/org/eclipse/jetty/ee9/annotations/TestAnnotationConfiguration.java b/jetty-ee9/jetty-ee9-annotations/src/test/java/org/eclipse/jetty/ee9/annotations/TestAnnotationConfiguration.java index e551272f32c8..f3b5798b2380 100644 --- a/jetty-ee9/jetty-ee9-annotations/src/test/java/org/eclipse/jetty/ee9/annotations/TestAnnotationConfiguration.java +++ b/jetty-ee9/jetty-ee9-annotations/src/test/java/org/eclipse/jetty/ee9/annotations/TestAnnotationConfiguration.java @@ -79,12 +79,12 @@ public void assertAnnotationDiscovery(boolean b) @BeforeEach public void setup() throws Exception { - web25 = MavenTestingUtils.getTestResourceFile("web25.xml"); - web31false = MavenTestingUtils.getTestResourceFile("web31false.xml"); - web31true = MavenTestingUtils.getTestResourceFile("web31true.xml"); + web25 = MavenTestingUtils.getTargetFile("test-classes/web25.xml"); + web31false = MavenTestingUtils.getTargetFile("test-classes/web31false.xml"); + web31true = MavenTestingUtils.getTargetFile("test-classes/web31true.xml"); // prepare an sci that will be on the webapp's classpath - jarDir = new File(MavenTestingUtils.getTestResourcesDir().getParentFile(), "jar"); + jarDir = new File(MavenTestingUtils.getTargetPath("test-classes").toFile(), "jar"); testSciJar = new File(jarDir, "test-sci.jar"); assertTrue(testSciJar.exists()); diff --git a/jetty-ee9/jetty-ee9-annotations/src/test/java/org/eclipse/jetty/ee9/annotations/TestAnnotationIntrospector.java b/jetty-ee9/jetty-ee9-annotations/src/test/java/org/eclipse/jetty/ee9/annotations/TestAnnotationIntrospector.java index 4f9a2b3a1446..13559e2cfdb3 100644 --- a/jetty-ee9/jetty-ee9-annotations/src/test/java/org/eclipse/jetty/ee9/annotations/TestAnnotationIntrospector.java +++ b/jetty-ee9/jetty-ee9-annotations/src/test/java/org/eclipse/jetty/ee9/annotations/TestAnnotationIntrospector.java @@ -62,28 +62,28 @@ public void testIsIntrospectable() throws Exception assertTrue(introspector.isIntrospectable(new ServletE(), holder)); //a DESCRIPTOR sourced servlet can be introspected if web.xml metdata-complete==false - File file = MavenTestingUtils.getTestResourceFile("web31false.xml"); + File file = MavenTestingUtils.getTargetFile("test-classes/web31false.xml"); Resource resource = Resource.newResource(file); wac.getMetaData().setWebDescriptor(new WebDescriptor(resource)); holder = new ServletHolder(new Source(Source.Origin.DESCRIPTOR, resource.toString())); assertTrue(introspector.isIntrospectable(new ServletE(), holder)); //a DESCRIPTOR sourced servlet can be introspected if web-fragment.xml medata-complete==false && web.xml metadata-complete==false - file = MavenTestingUtils.getTestResourceFile("web-fragment4false.xml"); + file = MavenTestingUtils.getTargetFile("test-classes/web-fragment4false.xml"); resource = Resource.newResource(file); wac.getMetaData().addFragmentDescriptor(Resource.newResource(file.getParentFile()), new FragmentDescriptor(resource)); holder = new ServletHolder(new Source(Source.Origin.DESCRIPTOR, resource.toString())); assertTrue(introspector.isIntrospectable(new ServletE(), holder)); //a DESCRIPTOR sourced servlet cannot be introspected if web-fragment.xml medata-complete==true (&& web.xml metadata-complete==false) - file = MavenTestingUtils.getTestResourceFile("web-fragment4true.xml"); + file = MavenTestingUtils.getTargetFile("test-classes/web-fragment4true.xml"); resource = Resource.newResource(file); wac.getMetaData().addFragmentDescriptor(Resource.newResource(file.getParentFile()), new FragmentDescriptor(resource)); holder = new ServletHolder(new Source(Source.Origin.DESCRIPTOR, resource.toString())); assertFalse(introspector.isIntrospectable(new ServletE(), holder)); //a DESCRIPTOR sourced servlet cannot be introspected if web.xml medata-complete==true - file = MavenTestingUtils.getTestResourceFile("web31true.xml"); + file = MavenTestingUtils.getTargetFile("test-classes/web31true.xml"); resource = Resource.newResource(file); wac.getMetaData().setWebDescriptor(new WebDescriptor(resource)); holder = new ServletHolder(new Source(Source.Origin.DESCRIPTOR, resource.toString())); diff --git a/jetty-ee9/jetty-ee9-annotations/src/test/java/org/eclipse/jetty/ee9/annotations/TestAnnotationParser.java b/jetty-ee9/jetty-ee9-annotations/src/test/java/org/eclipse/jetty/ee9/annotations/TestAnnotationParser.java index d7b492ca1bcf..fbbe440670fb 100644 --- a/jetty-ee9/jetty-ee9-annotations/src/test/java/org/eclipse/jetty/ee9/annotations/TestAnnotationParser.java +++ b/jetty-ee9/jetty-ee9-annotations/src/test/java/org/eclipse/jetty/ee9/annotations/TestAnnotationParser.java @@ -46,6 +46,7 @@ import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -183,7 +184,7 @@ public void handle(AnnotationParser.MethodInfo info, String annotation) @Test public void testHiddenFilesInJar() throws Exception { - File badClassesJar = MavenTestingUtils.getTestResourceFile("bad-classes.jar"); + File badClassesJar = MavenTestingUtils.getTargetFile("test-classes/bad-classes.jar"); AnnotationParser parser = new AnnotationParser(); Set emptySet = Collections.emptySet(); parser.parse(emptySet, badClassesJar.toURI()); @@ -193,7 +194,7 @@ public void testHiddenFilesInJar() throws Exception @Test public void testModuleInfoClassInJar() throws Exception { - File badClassesJar = MavenTestingUtils.getTestResourceFile("jdk9/slf4j-api-1.8.0-alpha2.jar"); + File badClassesJar = MavenTestingUtils.getTargetFile("test-classes/jdk9/slf4j-api-1.8.0-alpha2.jar"); AnnotationParser parser = new AnnotationParser(); Set emptySet = Collections.emptySet(); parser.parse(emptySet, badClassesJar.toURI()); @@ -203,7 +204,7 @@ public void testModuleInfoClassInJar() throws Exception @Test public void testJep238MultiReleaseInJar() throws Exception { - File badClassesJar = MavenTestingUtils.getTestResourceFile("jdk9/log4j-api-2.9.0.jar"); + File badClassesJar = MavenTestingUtils.getTargetFile("test-classes/jdk9/log4j-api-2.9.0.jar"); AnnotationParser parser = new AnnotationParser(); Set emptySet = Collections.emptySet(); parser.parse(emptySet, badClassesJar.toURI()); @@ -213,7 +214,7 @@ public void testJep238MultiReleaseInJar() throws Exception @Test public void testJep238MultiReleaseInJarJDK10() throws Exception { - File jdk10Jar = MavenTestingUtils.getTestResourceFile("jdk10/multirelease-10.jar"); + File jdk10Jar = MavenTestingUtils.getTargetFile("test-classes/jdk10/multirelease-10.jar"); AnnotationParser parser = new AnnotationParser(); DuplicateClassScanHandler handler = new DuplicateClassScanHandler(); Set handlers = Collections.singleton(handler); @@ -251,8 +252,8 @@ public void testBasedirExclusion() throws Exception @Test public void testScanDuplicateClassesInJars() throws Exception { - Resource testJar = Resource.newResource(MavenTestingUtils.getTestResourceFile("tinytest.jar")); - Resource testJar2 = Resource.newResource(MavenTestingUtils.getTestResourceFile("tinytest_copy.jar")); + Resource testJar = Resource.newResource(MavenTestingUtils.getTargetFile("test-classes/tinytest.jar")); + Resource testJar2 = Resource.newResource(MavenTestingUtils.getTargetFile("test-classes/tinytest_copy.jar")); AnnotationParser parser = new AnnotationParser(); DuplicateClassScanHandler handler = new DuplicateClassScanHandler(); Set handlers = Collections.singleton(handler); @@ -267,7 +268,7 @@ public void testScanDuplicateClassesInJars() throws Exception @Test public void testScanDuplicateClasses() throws Exception { - Resource testJar = Resource.newResource(MavenTestingUtils.getTestResourceFile("tinytest.jar")); + Resource testJar = Resource.newResource(MavenTestingUtils.getTargetFile("test-classes/tinytest.jar")); File testClasses = new File(MavenTestingUtils.getTargetDir(), "test-classes"); AnnotationParser parser = new AnnotationParser(); DuplicateClassScanHandler handler = new DuplicateClassScanHandler(); @@ -277,7 +278,7 @@ public void testScanDuplicateClasses() throws Exception List locations = handler.getParsedList("org.acme.ClassOne"); assertNotNull(locations); assertEquals(2, locations.size()); - assertTrue(!(locations.get(0).equals(locations.get(1)))); + assertFalse((locations.get(0).equals(locations.get(1)))); } private void copyClass(Class clazz, File basedir) throws IOException diff --git a/jetty-ee9/jetty-ee9-jaas/pom.xml b/jetty-ee9/jetty-ee9-jaas/pom.xml index 3c4870813a40..4c7ba2412cbb 100644 --- a/jetty-ee9/jetty-ee9-jaas/pom.xml +++ b/jetty-ee9/jetty-ee9-jaas/pom.xml @@ -31,6 +31,7 @@ false false + --add-opens java.base/sun.security.x509=ALL-UNNAMED --add-opens java.base/sun.security.util=ALL-UNNAMED @@ -145,26 +146,5 @@ - - - jdk16 - - [16,) - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - --add-opens java.base/sun.security.x509=ALL-UNNAMED --add-opens java.base/sun.security.util=ALL-UNNAMED - - - - - - - diff --git a/jetty-ee9/jetty-ee9-jaas/src/main/config/modules/jaas.mod b/jetty-ee9/jetty-ee9-jaas/src/main/config/modules/jaas.mod index 9816e7b487cd..e87fcdcd9269 100644 --- a/jetty-ee9/jetty-ee9-jaas/src/main/config/modules/jaas.mod +++ b/jetty-ee9/jetty-ee9-jaas/src/main/config/modules/jaas.mod @@ -7,7 +7,7 @@ Enables JAAS for deployed web applications. server [lib] -lib/jetty-jaas-${jetty.version}.jar +lib/jetty-ee9-jaas-${jetty.version}.jar [xml] etc/jetty-jaas.xml diff --git a/jetty-ee9/jetty-ee9-plus/src/main/config/modules/plus.mod b/jetty-ee9/jetty-ee9-plus/src/main/config/modules/plus.mod index e3d01582c51e..32677fe77aaf 100644 --- a/jetty-ee9/jetty-ee9-plus/src/main/config/modules/plus.mod +++ b/jetty-ee9/jetty-ee9-plus/src/main/config/modules/plus.mod @@ -8,5 +8,5 @@ jndi webapp [lib] -lib/jetty-plus-${jetty.version}.jar +lib/jetty-ee9-plus-${jetty.version}.jar lib/jakarta.transaction-api-*.jar diff --git a/jetty-ee9/jetty-ee9-security/src/test/java/org/eclipse/jetty/ee9/security/AliasedConstraintTest.java b/jetty-ee9/jetty-ee9-security/src/test/java/org/eclipse/jetty/ee9/security/AliasedConstraintTest.java index 801624bf010d..fa4825863b1f 100644 --- a/jetty-ee9/jetty-ee9-security/src/test/java/org/eclipse/jetty/ee9/security/AliasedConstraintTest.java +++ b/jetty-ee9/jetty-ee9-security/src/test/java/org/eclipse/jetty/ee9/security/AliasedConstraintTest.java @@ -73,7 +73,7 @@ public static void startServer() throws Exception loginService.putUser("user3", new Password("password"), new String[]{"foo"}); context.setContextPath("/ctx"); - context.setResourceBase(MavenTestingUtils.getTestResourceDir("docroot").getAbsolutePath()); + context.setResourceBase(MavenTestingUtils.getTargetFile("test-classes/docroot").getAbsolutePath()); Handler.Collection handlers = new Handler.Collection(); handlers.addHandler(context); diff --git a/jetty-ee9/jetty-ee9-security/src/test/java/org/eclipse/jetty/ee9/security/ClientCertAuthenticatorTest.java b/jetty-ee9/jetty-ee9-security/src/test/java/org/eclipse/jetty/ee9/security/ClientCertAuthenticatorTest.java index 90a6821f7a66..9a6979de3787 100644 --- a/jetty-ee9/jetty-ee9-security/src/test/java/org/eclipse/jetty/ee9/security/ClientCertAuthenticatorTest.java +++ b/jetty-ee9/jetty-ee9-security/src/test/java/org/eclipse/jetty/ee9/security/ClientCertAuthenticatorTest.java @@ -111,7 +111,7 @@ public void setup() throws Exception HashLoginService loginService = new HashLoginService(); constraintSecurityHandler.setLoginService(loginService); - loginService.setConfig("src/test/resources/realm.properties"); + loginService.setConfig("target/test-classes/realm.properties"); constraintSecurityHandler.setHandler(new FooHandler()); context.setHandler(constraintSecurityHandler); @@ -147,8 +147,8 @@ private SslContextFactory.Server createServerSslContextFactory(String trustStore SslContextFactory.Server cf = new SslContextFactory.Server(); cf.setNeedClientAuth(true); cf.setTrustStorePassword(trustStorePassword); - cf.setTrustStoreResource(Resource.newResource(MavenTestingUtils.getTestResourcePath(trustStorePath))); - cf.setKeyStoreResource(Resource.newResource(MavenTestingUtils.getTestResourcePath("clientcert.jks"))); + cf.setTrustStoreResource(Resource.newResource(MavenTestingUtils.getTargetPath("test-classes/" + trustStorePath))); + cf.setKeyStoreResource(Resource.newResource(MavenTestingUtils.getTargetPath("test-classes/clientcert.jks"))); cf.setKeyStorePassword("changeit"); cf.setSniRequired(false); cf.setWantClientAuth(true); diff --git a/jetty-ee9/jetty-ee9-security/src/test/java/org/eclipse/jetty/ee9/security/HashLoginServiceTest.java b/jetty-ee9/jetty-ee9-security/src/test/java/org/eclipse/jetty/ee9/security/HashLoginServiceTest.java index ce200034d201..831965590b14 100644 --- a/jetty-ee9/jetty-ee9-security/src/test/java/org/eclipse/jetty/ee9/security/HashLoginServiceTest.java +++ b/jetty-ee9/jetty-ee9-security/src/test/java/org/eclipse/jetty/ee9/security/HashLoginServiceTest.java @@ -31,7 +31,8 @@ public class HashLoginServiceTest @Test public void testAutoCreatedUserStore() throws Exception { - HashLoginService loginService = new HashLoginService("foo", MavenTestingUtils.getTestResourceFile("foo.properties").getAbsolutePath()); + HashLoginService loginService = new HashLoginService("foo", + MavenTestingUtils.getTargetFile("test-classes/foo.properties").getAbsolutePath()); assertThat(loginService.getIdentityService(), is(notNullValue())); loginService.start(); assertTrue(loginService.getUserStore().isStarted()); diff --git a/jetty-ee9/jetty-ee9-security/src/test/java/org/eclipse/jetty/ee9/security/PropertyUserStoreTest.java b/jetty-ee9/jetty-ee9-security/src/test/java/org/eclipse/jetty/ee9/security/PropertyUserStoreTest.java index 192de4684523..29bd997d6f6a 100644 --- a/jetty-ee9/jetty-ee9-security/src/test/java/org/eclipse/jetty/ee9/security/PropertyUserStoreTest.java +++ b/jetty-ee9/jetty-ee9-security/src/test/java/org/eclipse/jetty/ee9/security/PropertyUserStoreTest.java @@ -55,7 +55,7 @@ public class PropertyUserStoreTest private final class UserCount implements PropertyUserStore.UserListener { private final AtomicInteger userCount = new AtomicInteger(); - private final List users = new ArrayList(); + private final List users = new ArrayList<>(); private UserCount() { @@ -80,7 +80,7 @@ public void remove(String username) public void awaitCount(int expectedCount) throws InterruptedException { - long timeout = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()) + TimeUnit.SECONDS.toMillis(10); + long timeout = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()) + TimeUnit.SECONDS.toMillis(20); while (userCount.get() != expectedCount && (TimeUnit.NANOSECONDS.toMillis(System.nanoTime()) < timeout)) { diff --git a/jetty-ee9/jetty-ee9-servlet/src/main/config/modules/ee9-servlet.mod b/jetty-ee9/jetty-ee9-servlet/src/main/config/modules/ee9-servlet.mod index 76bc121169b3..a42ac376a92e 100644 --- a/jetty-ee9/jetty-ee9-servlet/src/main/config/modules/ee9-servlet.mod +++ b/jetty-ee9/jetty-ee9-servlet/src/main/config/modules/ee9-servlet.mod @@ -10,6 +10,7 @@ ee9 server sessions +# FIXME should servlet api version be interpolated [lib] lib/jetty-jakarta-servlet-api-5.0.2.jar lib/jetty-ee9-nested-${jetty.version}.jar diff --git a/jetty-ee9/jetty-ee9-servlet/src/main/java/org/eclipse/jetty/ee9/servlet/FilterHolder.java b/jetty-ee9/jetty-ee9-servlet/src/main/java/org/eclipse/jetty/ee9/servlet/FilterHolder.java index c84b7473caab..77b11290422e 100644 --- a/jetty-ee9/jetty-ee9-servlet/src/main/java/org/eclipse/jetty/ee9/servlet/FilterHolder.java +++ b/jetty-ee9/jetty-ee9-servlet/src/main/java/org/eclipse/jetty/ee9/servlet/FilterHolder.java @@ -94,7 +94,7 @@ public void doStart() if (!jakarta.servlet.Filter.class.isAssignableFrom(getHeldClass())) { - String msg = getHeldClass() + " is not a jakarta.servlet.Filter"; + String msg = getHeldClass() + " is not a " + Filter.class.getName(); doStop(); throw new IllegalStateException(msg); } diff --git a/jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/CacheControlHeaderTest.java b/jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/CacheControlHeaderTest.java index 6610c9173ee7..5f0010137868 100644 --- a/jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/CacheControlHeaderTest.java +++ b/jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/CacheControlHeaderTest.java @@ -94,7 +94,7 @@ public void startServer(boolean forceFilter, boolean forceWrapping) throws Excep ServletHolder servletHolder = new ServletHolder(); servletHolder.setServlet(new DefaultServlet()); servletHolder.setInitParameter("cacheControl", "max-age=3600,public"); - Path resBase = MavenTestingUtils.getTestResourcePathDir("contextResources"); + Path resBase = MavenTestingUtils.getTargetPath("test-classes/contextResources"); servletHolder.setInitParameter("resourceBase", resBase.toFile().toURI().toASCIIString()); context.addServlet(servletHolder, "/*"); if (forceFilter) diff --git a/jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/DefaultServletTest.java b/jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/DefaultServletTest.java index e5918a44a4bf..d0b591c3dfc6 100644 --- a/jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/DefaultServletTest.java +++ b/jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/DefaultServletTest.java @@ -112,7 +112,7 @@ public void init() throws Exception connector = new LocalConnector(server); connector.getConnectionFactory(HttpConfiguration.ConnectionFactory.class).getHttpConfiguration().setSendServerVersion(false); - File extraJarResources = MavenTestingUtils.getTestResourceFile(ODD_JAR); + File extraJarResources = MavenTestingUtils.getTargetFile(ODD_JAR); URL[] urls = new URL[]{extraJarResources.toURI().toURL()}; ClassLoader parentClassLoader = Thread.currentThread().getContextClassLoader(); diff --git a/jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/DispatcherTest.java b/jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/DispatcherTest.java index 40399adbf404..17951119abbb 100644 --- a/jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/DispatcherTest.java +++ b/jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/DispatcherTest.java @@ -94,7 +94,7 @@ public void init() throws Exception _contextHandler.setContextPath("/context"); _contextCollection.addHandler(_contextHandler); _resourceHandler = new ResourceHandler(); - _resourceHandler.setResourceBase(MavenTestingUtils.getTestResourceDir("dispatchResourceTest").getAbsolutePath()); + _resourceHandler.setResourceBase(MavenTestingUtils.getTargetFile("test-classes/dispatchResourceTest").getAbsolutePath()); _resourceHandler.setPathInfoOnly(true); ContextHandler resourceContextHandler = new ContextHandler("/resource"); resourceContextHandler.setHandler(_resourceHandler); diff --git a/jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/SSLAsyncIOServletTest.java b/jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/SSLAsyncIOServletTest.java index b903ec11bd49..f6b61ebd6c60 100644 --- a/jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/SSLAsyncIOServletTest.java +++ b/jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/SSLAsyncIOServletTest.java @@ -213,7 +213,7 @@ public String getServletPath() public void start(HttpServlet servlet) throws Exception { - Path keystorePath = MavenTestingUtils.getTestResourcePath("keystore.p12"); + Path keystorePath = MavenTestingUtils.getTargetPath("test-classes/keystore.p12"); sslContextFactory = new SslContextFactory.Server(); sslContextFactory.setKeyStorePath(keystorePath.toString()); diff --git a/jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/ServletContextResourcesTest.java b/jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/ServletContextResourcesTest.java index e513213d5be2..29a565310d32 100644 --- a/jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/ServletContextResourcesTest.java +++ b/jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/ServletContextResourcesTest.java @@ -77,7 +77,7 @@ public void init() throws Exception connector = new LocalConnector(server); connector.getConnectionFactory(HttpConfiguration.ConnectionFactory.class).getHttpConfiguration().setSendServerVersion(false); - Path resBase = MavenTestingUtils.getTestResourcePathDir("contextResources"); + Path resBase = MavenTestingUtils.getTargetPath("test-classes/contextResources"); context = new ServletContextHandler(); context.setContextPath("/context"); diff --git a/jetty-ee9/jetty-ee9-servlets/src/main/config/modules/servlets.mod b/jetty-ee9/jetty-ee9-servlets/src/main/config/modules/servlets.mod index 36b85d686f38..aec6bfee55a5 100644 --- a/jetty-ee9/jetty-ee9-servlets/src/main/config/modules/servlets.mod +++ b/jetty-ee9/jetty-ee9-servlets/src/main/config/modules/servlets.mod @@ -9,5 +9,5 @@ MultiPartFilter, PushCacheFilter, QoSFilter, etc.) for use by all webapplication servlet [lib] -lib/jetty-servlets-${jetty.version}.jar +lib/jetty-ee9-servlets-${jetty.version}.jar diff --git a/jetty-ee9/jetty-ee9-servlets/src/test/java/org/eclipse/jetty/ee9/servlets/GzipDefaultServletTest.java b/jetty-ee9/jetty-ee9-servlets/src/test/java/org/eclipse/jetty/ee9/servlets/GzipDefaultServletTest.java index f3e61da999d5..ddfd0f364897 100644 --- a/jetty-ee9/jetty-ee9-servlets/src/test/java/org/eclipse/jetty/ee9/servlets/GzipDefaultServletTest.java +++ b/jetty-ee9/jetty-ee9-servlets/src/test/java/org/eclipse/jetty/ee9/servlets/GzipDefaultServletTest.java @@ -354,7 +354,7 @@ public void testGzippedIfSVG() throws Exception server.setHandler(gzipHandler); // Prepare Server File - Path testResource = MavenTestingUtils.getTestResourcePath("test.svg"); + Path testResource = MavenTestingUtils.getTargetPath("test-classes/test.svg"); Path file = contextDir.resolve("test.svg"); IO.copy(testResource.toFile(), file.toFile()); String expectedSha1Sum = Sha1Sum.calculate(testResource); @@ -898,7 +898,7 @@ public void testIsNotGzipCompressedSVGZ() throws Exception gzipHandler.setHandler(servletContextHandler); server.setHandler(gzipHandler); // Prepare Server File - Path testResource = MavenTestingUtils.getTestResourcePath("test.svgz"); + Path testResource = MavenTestingUtils.getTargetPath("test-classes/test.svgz"); Path file = contextDir.resolve("test.svgz"); IO.copy(testResource.toFile(), file.toFile()); int fileSize = (int)Files.size(file); diff --git a/jetty-ee9/jetty-ee9-servlets/src/test/java/org/eclipse/jetty/ee9/servlets/GzipHandlerNoReCompressTest.java b/jetty-ee9/jetty-ee9-servlets/src/test/java/org/eclipse/jetty/ee9/servlets/GzipHandlerNoReCompressTest.java index 02ec5f501638..b2de6b7e0dde 100644 --- a/jetty-ee9/jetty-ee9-servlets/src/test/java/org/eclipse/jetty/ee9/servlets/GzipHandlerNoReCompressTest.java +++ b/jetty-ee9/jetty-ee9-servlets/src/test/java/org/eclipse/jetty/ee9/servlets/GzipHandlerNoReCompressTest.java @@ -103,10 +103,11 @@ public void testNotGzipAlreadyCompressed(String fileName, String expectedContent server.setHandler(gzipHandler); // Prepare Server File - Path testResource = MavenTestingUtils.getTestResourcePath(fileName); + Path testResource = MavenTestingUtils.getTargetPath("test-classes/" + fileName); Path file = contextDir.resolve(fileName); IO.copy(testResource.toFile(), file.toFile()); - String expectedSha1Sum = Sha1Sum.loadSha1(MavenTestingUtils.getTestResourceFile(fileName + ".sha1")).toUpperCase(Locale.ENGLISH); + String expectedSha1Sum = Sha1Sum.loadSha1(MavenTestingUtils.getTargetFile("test-classes/" + fileName + ".sha1")) + .toUpperCase(Locale.ENGLISH); int fileSize = (int)Files.size(file); server.start(); diff --git a/jetty-ee9/jetty-ee9-webapp/pom.xml b/jetty-ee9/jetty-ee9-webapp/pom.xml index 8b2686a12c7e..1bb69751e12c 100644 --- a/jetty-ee9/jetty-ee9-webapp/pom.xml +++ b/jetty-ee9/jetty-ee9-webapp/pom.xml @@ -29,6 +29,19 @@ + + + src/test/resources + + + src/test/webapp + webapp + + + src/test/webapp-alt-jsp + webapp-alt-jsp + + diff --git a/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/ClassMatcherTest.java b/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/ClassMatcherTest.java index 6f4cd1bbbe75..5c5aa532d571 100644 --- a/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/ClassMatcherTest.java +++ b/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/ClassMatcherTest.java @@ -35,13 +35,7 @@ public class ClassMatcherTest { private final ClassMatcher _pattern = new ClassMatcher(); - protected static Supplier NULL_SUPPLIER = new Supplier() - { - public URI get() - { - return null; - } - }; + protected static Supplier NULL_SUPPLIER = () -> null; @BeforeEach public void before() diff --git a/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/ForcedServletTest.java b/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/ForcedServletTest.java index d39f2cc4713b..fb3f5873dc3c 100644 --- a/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/ForcedServletTest.java +++ b/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/ForcedServletTest.java @@ -14,8 +14,12 @@ package org.eclipse.jetty.ee9.webapp; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; +import java.nio.file.OpenOption; import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardOpenOption; import java.util.Arrays; import java.util.Iterator; import java.util.stream.Stream; @@ -62,9 +66,14 @@ public void setup() throws Exception // Lets setup the Webapp base resource properly Path basePath = MavenTestingUtils.getTargetTestingPath(ForcedServletTest.class.getName()).resolve("webapp"); FS.ensureEmpty(basePath); - Path srcWebApp = MavenTestingUtils.getProjectDirPath("src/test/webapp-alt-jsp"); + Path srcWebApp = MavenTestingUtils.getTargetPath("test-classes/webapp-alt-jsp"); copyDir(srcWebApp, basePath); copyClass(FakePrecompiledJSP.class, basePath.resolve("WEB-INF/classes")); + Path webXml = basePath.resolve("WEB-INF/web.xml"); + String webXmContent = Files.readString(webXml); + webXmContent = webXmContent.replace("${fakePrecompiledJspClassName}", FakePrecompiledJSP.class.getName()); + Files.writeString(webXml, webXmContent, StandardCharsets.UTF_8, StandardOpenOption.TRUNCATE_EXISTING); + // Use the new base context.setWarResource(new PathResource(basePath)); diff --git a/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/MetaInfConfigurationTest.java b/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/MetaInfConfigurationTest.java index e09e0ef1b244..a67102f5036f 100644 --- a/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/MetaInfConfigurationTest.java +++ b/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/MetaInfConfigurationTest.java @@ -76,9 +76,9 @@ public void scanJars(WebAppContext context, Collection jars, boolean u @Test public void testScanTypes() throws Exception { - File web25 = MavenTestingUtils.getTestResourceFile("web25.xml"); - File web31 = MavenTestingUtils.getTestResourceFile("web31.xml"); - File web31false = MavenTestingUtils.getTestResourceFile("web31false.xml"); + File web25 = MavenTestingUtils.getTargetFile("test-classes/web25.xml"); + File web31 = MavenTestingUtils.getTargetFile("test-classes/web31.xml"); + File web31false = MavenTestingUtils.getTargetFile("test-classes/web31false.xml"); //test a 2.5 webapp will not look for fragments as manually configured MetaInfConfiguration meta25 = new TestableMetaInfConfiguration(MetaInfConfiguration.__allScanTypes, diff --git a/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/StandardDescriptorProcessorTest.java b/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/StandardDescriptorProcessorTest.java index 76e526bf4698..892d0703a9a5 100644 --- a/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/StandardDescriptorProcessorTest.java +++ b/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/StandardDescriptorProcessorTest.java @@ -29,7 +29,7 @@ public class StandardDescriptorProcessorTest @Test public void testVisitSessionConfig() throws Exception { - File webXml = MavenTestingUtils.getTestResourceFile("web-session-config.xml"); + File webXml = MavenTestingUtils.getTargetFile("test-classes/web-session-config.xml"); Server server = new Server(); WebAppContext wac = new WebAppContext(); wac.setServer(server); diff --git a/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/TempDirTest.java b/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/TempDirTest.java index e67be8ebed79..87b4217e2966 100644 --- a/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/TempDirTest.java +++ b/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/TempDirTest.java @@ -16,6 +16,7 @@ import java.io.File; import java.nio.file.Files; import java.nio.file.Path; +import java.nio.file.Paths; import jakarta.servlet.ServletContext; import org.eclipse.jetty.server.Server; @@ -59,7 +60,7 @@ public void setupServer() ServerConnector connector = new ServerConnector(server); server.addConnector(connector); - File testWebAppDir = MavenTestingUtils.getProjectDir("src/test/webapp"); + File testWebAppDir = MavenTestingUtils.getTargetPath("test-classes/webapp").toFile(); webapp = new WebAppContext(); webapp.setContextPath("/"); webapp.setWar(testWebAppDir.getAbsolutePath()); @@ -108,7 +109,7 @@ public void attributeWithEmptyStringValue() public void attributeWithValidDirectory(String type) throws Exception { WebAppContext webAppContext = new WebAppContext(); - Path tmpDir = Files.createTempDirectory("jetty_test"); + Path tmpDir = Files.createTempDirectory(Paths.get(System.getProperty("java.io.tmpdir")), "jetty_test"); switch (type) { case "File": @@ -138,7 +139,8 @@ public void attributeWithValidDirectory(String type) throws Exception public void attributeWithNonExistentDirectory(String type) throws Exception { WebAppContext webAppContext = new WebAppContext(); - Path tmpDir = Files.createTempDirectory("jetty_test").resolve("foo_test_tmp"); + Path tmpDir = Files.createTempDirectory(Paths.get(System.getProperty("java.io.tmpdir")), "jetty_test") + .resolve("foo_test_tmp"); Files.deleteIfExists(tmpDir); assertFalse(Files.exists(tmpDir)); switch (type) @@ -199,7 +201,7 @@ public void baseTempDirAttributeWithEmptyStringValue() public void baseTempDirAttributeWithValidDirectory(String type) throws Exception { WebAppContext webAppContext = new WebAppContext(); - Path tmpDir = Files.createTempDirectory("jetty_test"); + Path tmpDir = Files.createTempDirectory(Paths.get(System.getProperty("java.io.tmpdir")), "jetty_test"); switch (type) { case "File": @@ -231,7 +233,8 @@ public void baseTempDirAttributeWithValidDirectory(String type) throws Exception public void baseTempDirAttributeWithNonExistentDirectory(String type) throws Exception { WebAppContext webAppContext = new WebAppContext(); - Path tmpDir = Files.createTempDirectory("jetty_test").resolve("foo_test_tmp"); + Path tmpDir = Files.createTempDirectory(Paths.get(System.getProperty("java.io.tmpdir")), "jetty_test") + .resolve("foo_test_tmp"); Files.deleteIfExists(tmpDir); assertFalse(Files.exists(tmpDir)); switch (type) diff --git a/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/TestMetaData.java b/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/TestMetaData.java index 7a48623061a2..230c1fa79074 100644 --- a/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/TestMetaData.java +++ b/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/TestMetaData.java @@ -53,7 +53,7 @@ public class TestMetaData @BeforeEach public void setUp() throws Exception { - File jarDir = new File(MavenTestingUtils.getTestResourcesDir(), "fragments"); + File jarDir = new File(MavenTestingUtils.getTargetFile("test-classes"), "fragments"); assertTrue(jarDir.exists()); fragFile = new File(jarDir, "zeta.jar"); assertTrue(fragFile.exists()); diff --git a/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/WebAppClassLoaderTest.java b/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/WebAppClassLoaderTest.java index 5eb0684d870f..3d1f8a62b0f5 100644 --- a/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/WebAppClassLoaderTest.java +++ b/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/WebAppClassLoaderTest.java @@ -53,13 +53,13 @@ public class WebAppClassLoaderTest @BeforeEach public void init() throws Exception { - this.testWebappDir = MavenTestingUtils.getProjectDirPath("src/test/webapp"); + this.testWebappDir = MavenTestingUtils.getTargetPath("test-classes/webapp"); Resource webapp = new PathResource(testWebappDir); _context = new WebAppContext(); _context.setBaseResource(webapp); _context.setContextPath("/test"); - _context.setExtraClasspath("src/test/resources/ext/*"); + _context.setExtraClasspath("target/test-classes/ext/*"); _loader = new WebAppClassLoader(_context); _loader.addJars(webapp.addPath("WEB-INF/lib")); diff --git a/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/WebAppContextTest.java b/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/WebAppContextTest.java index 75d8ab62d6e6..18071ff3f536 100644 --- a/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/WebAppContextTest.java +++ b/jetty-ee9/jetty-ee9-webapp/src/test/java/org/eclipse/jetty/ee9/webapp/WebAppContextTest.java @@ -95,10 +95,10 @@ private Server newServer() public void testDefaultContextPath() throws Exception { Server server = newServer(); - File webXml = MavenTestingUtils.getTestResourceFile("web-with-default-context-path.xml"); - File webXmlEmptyPath = MavenTestingUtils.getTestResourceFile("web-with-empty-default-context-path.xml"); - File webDefaultXml = MavenTestingUtils.getTestResourceFile("web-default-with-default-context-path.xml"); - File overrideWebXml = MavenTestingUtils.getTestResourceFile("override-web-with-default-context-path.xml"); + File webXml = MavenTestingUtils.getTargetFile("test-classes/web-with-default-context-path.xml"); + File webXmlEmptyPath = MavenTestingUtils.getTargetFile("test-classes/web-with-empty-default-context-path.xml"); + File webDefaultXml = MavenTestingUtils.getTargetFile("test-classes/web-default-with-default-context-path.xml"); + File overrideWebXml = MavenTestingUtils.getTargetFile("test-classes/override-web-with-default-context-path.xml"); assertNotNull(webXml); assertNotNull(webDefaultXml); assertNotNull(overrideWebXml); @@ -301,7 +301,7 @@ public void testProtectedTarget() throws Exception handlers.addHandler(contexts); WebAppContext context = new WebAppContext(); - Path testWebapp = MavenTestingUtils.getProjectDirPath("src/test/webapp"); + Path testWebapp = MavenTestingUtils.getTargetPath("test-classes/webapp"); context.setBaseResource(new PathResource(testWebapp)); context.setContextPath("/"); @@ -365,7 +365,7 @@ public void testProtectedTargetFailure(String path) throws Exception handlers.addHandler(contexts); WebAppContext context = new WebAppContext(); - Path testWebapp = MavenTestingUtils.getProjectDirPath("src/test/webapp"); + Path testWebapp = MavenTestingUtils.getTargetPath("test-classes/webapp"); context.setBaseResource(new PathResource(testWebapp)); context.setContextPath("/"); contexts.addHandler(context); @@ -388,7 +388,7 @@ public void testNullPath() throws Exception handlers.addHandler(contexts); WebAppContext context = new WebAppContext(); - Path testWebapp = MavenTestingUtils.getProjectDirPath("src/test/webapp"); + Path testWebapp = MavenTestingUtils.getTargetPath("test-classes/webapp"); context.setBaseResource(new PathResource(testWebapp)); context.setContextPath("/"); @@ -418,7 +418,7 @@ public void testNullSessionAndSecurityHandler() throws Exception WebAppContext context = new WebAppContext(null, null, null, null, null, new ErrorPageErrorHandler(), ServletContextHandler.NO_SESSIONS | ServletContextHandler.NO_SECURITY); context.setContextPath("/"); - Path testWebapp = MavenTestingUtils.getProjectDirPath("src/test/webapp"); + Path testWebapp = MavenTestingUtils.getTargetPath("test-classes/webapp"); context.setBaseResource(new PathResource(testWebapp)); contexts.addHandler(context); @@ -455,7 +455,7 @@ public void testBaseResourceAbsolutePath() throws Exception WebAppContext context = new WebAppContext(); context.setContextPath("/"); - Path warPath = MavenTestingUtils.getTestResourcePathFile("wars/dump.war"); + Path warPath = MavenTestingUtils.getTargetPath("test-classes/wars/dump.war"); warPath = warPath.toAbsolutePath(); assertTrue(warPath.isAbsolute(), "Path should be absolute: " + warPath); // Use String reference to war @@ -474,7 +474,7 @@ public static Stream extraClasspathGlob() { List references = new ArrayList<>(); - Path extLibs = MavenTestingUtils.getTestResourcePathDir("ext"); + Path extLibs = MavenTestingUtils.getTargetPath("test-classes/ext"); extLibs = extLibs.toAbsolutePath(); // Absolute reference with trailing slash and glob @@ -500,7 +500,7 @@ public void testExtraClasspathGlob(String description, String extraClasspathGlob WebAppContext context = new WebAppContext(); context.setContextPath("/"); - Path warPath = MavenTestingUtils.getTestResourcePathFile("wars/dump.war"); + Path warPath = MavenTestingUtils.getTargetPath("test-classes/wars/dump.war"); context.setBaseResource(new PathResource(warPath)); context.setExtraClasspath(extraClasspathGlobReference); @@ -514,7 +514,7 @@ public void testExtraClasspathGlob(String description, String extraClasspathGlob ClassLoader contextClassLoader = context.getClassLoader(); assertThat(contextClassLoader, instanceOf(WebAppClassLoader.class)); WebAppClassLoader webAppClassLoader = (WebAppClassLoader)contextClassLoader; - Path extLibsDir = MavenTestingUtils.getTestResourcePathDir("ext"); + Path extLibsDir = MavenTestingUtils.getTargetPath("test-classes/ext"); extLibsDir = extLibsDir.toAbsolutePath(); List expectedPaths; try (Stream s = Files.list(extLibsDir)) @@ -548,7 +548,7 @@ public static Stream extraClasspathDir() { List references = new ArrayList<>(); - Path extLibs = MavenTestingUtils.getTestResourcePathDir("ext"); + Path extLibs = MavenTestingUtils.getTargetPath("test-classes/ext"); extLibs = extLibs.toAbsolutePath(); // Absolute reference with trailing slash @@ -580,7 +580,7 @@ public void testExtraClasspathDir(String extraClassPathReference) throws Excepti WebAppContext context = new WebAppContext(); context.setContextPath("/"); - Path warPath = MavenTestingUtils.getTestResourcePathFile("wars/dump.war"); + Path warPath = MavenTestingUtils.getTargetPath("test-classes/wars/dump.war"); context.setBaseResource(new PathResource(warPath)); context.setExtraClasspath(extraClassPathReference); @@ -597,7 +597,7 @@ public void testExtraClasspathDir(String extraClassPathReference) throws Excepti WebAppClassLoader webAppClassLoader = (WebAppClassLoader)contextClassLoader; URL[] urls = webAppClassLoader.getURLs(); assertThat("URLs", urls.length, is(1)); - Path extLibs = MavenTestingUtils.getTestResourcePathDir("ext"); + Path extLibs = MavenTestingUtils.getTargetPath("test-classes/ext"); extLibs = extLibs.toAbsolutePath(); assertThat("URL[0]", urls[0].toURI(), is(extLibs.toUri())); } diff --git a/jetty-ee9/jetty-ee9-webapp/src/test/webapp-alt-jsp/WEB-INF/web.xml b/jetty-ee9/jetty-ee9-webapp/src/test/webapp-alt-jsp/WEB-INF/web.xml index c86c5dd7a344..0e02711024bb 100644 --- a/jetty-ee9/jetty-ee9-webapp/src/test/webapp-alt-jsp/WEB-INF/web.xml +++ b/jetty-ee9/jetty-ee9-webapp/src/test/webapp-alt-jsp/WEB-INF/web.xml @@ -17,7 +17,7 @@ precompiledName - org.eclipse.jetty.ee9.webapp.ForcedServletTest$FakePrecompiledJSP + ${fakePrecompiledJspClassName} precompiledName diff --git a/pom.xml b/pom.xml index cb7f86455eca..139115290fe2 100644 --- a/pom.xml +++ b/pom.xml @@ -179,6 +179,16 @@ true + + jetty.snapshots + https://oss.sonatype.org/content/repositories/jetty-snapshots + + false + + + true + + @@ -186,6 +196,7 @@ jetty-core jetty-integrations + jetty-ee8 jetty-ee9 jetty-ee10 jetty-home