From 0ca321172937d073b7c744f27b1dfd7fca009f35 Mon Sep 17 00:00:00 2001 From: Vincent Latombe Date: Fri, 31 Jan 2025 09:30:58 +0100 Subject: [PATCH 1/3] Reapply "[JENKINS-75174] Move existing `web.xml` to `web-fragment.xml` under core (#10185)" (#10225) This reverts commit 6109053fa281b59b3752b36341d692deb08cc25b. --- .../main/resources/META-INF/web-fragment.xml | 279 ++++++++++++++++++ war/src/main/webapp/WEB-INF/web.xml | 251 +--------------- 2 files changed, 280 insertions(+), 250 deletions(-) create mode 100644 core/src/main/resources/META-INF/web-fragment.xml diff --git a/core/src/main/resources/META-INF/web-fragment.xml b/core/src/main/resources/META-INF/web-fragment.xml new file mode 100644 index 000000000000..c9acb6e1513c --- /dev/null +++ b/core/src/main/resources/META-INF/web-fragment.xml @@ -0,0 +1,279 @@ + + + + + jenkins + + + Stapler + org.kohsuke.stapler.Stapler + + default-encodings + text/html=UTF-8 + + + diagnosticThreadName + false + + true + + + + Stapler + /* + + + + suspicious-request-filter + jenkins.security.SuspiciousRequestFilter + true + + + diagnostic-name-filter + org.kohsuke.stapler.DiagnosticThreadNameFilter + true + + + encoding-filter + hudson.util.CharacterEncodingFilter + true + + + uncaught-exception-filter + org.kohsuke.stapler.UncaughtExceptionFilter + true + + + authentication-filter + hudson.security.HudsonFilter + true + + + csrf-filter + hudson.security.csrf.CrumbFilter + true + + + error-attribute-filter + jenkins.ErrorAttributeFilter + true + + + plugins-filter + hudson.util.PluginServletFilter + true + + + + + + suspicious-request-filter + /* + + + diagnostic-name-filter + /* + + + encoding-filter + /* + + + uncaught-exception-filter + /* + + + authentication-filter + /* + + + csrf-filter + /* + + + error-attribute-filter + /* + + + plugins-filter + /* + + + + + jenkins.util.SystemProperties$Listener + + + hudson.WebAppMain + + + jenkins.JenkinsHttpSessionListener + + + + + admin + + + user + + + hudson + + + + + Hudson + /loginEntry + + + + ** + + + + + + + Disable TRACE + /* + TRACE + + + + + + + other + /* + + + + + + FORM + + /login + /loginError + + + + + + xml + application/xml + + + + log + text/plain + + + war + application/octet-stream + + + ear + application/octet-stream + + + rar + application/octet-stream + + + webm + video/webm + + + + java.lang.Throwable + /oops + + + 404 + /404 + + + + + + true + + + + diff --git a/war/src/main/webapp/WEB-INF/web.xml b/war/src/main/webapp/WEB-INF/web.xml index 4ef6db9e3fb5..5e86c73a222e 100644 --- a/war/src/main/webapp/WEB-INF/web.xml +++ b/war/src/main/webapp/WEB-INF/web.xml @@ -26,256 +26,7 @@ THE SOFTWARE. + version="3.1"> Jenkins v${project.version} Build management system - - - Stapler - org.kohsuke.stapler.Stapler - - default-encodings - text/html=UTF-8 - - - diagnosticThreadName - false - - true - - - - Stapler - /* - - - - suspicious-request-filter - jenkins.security.SuspiciousRequestFilter - true - - - diagnostic-name-filter - org.kohsuke.stapler.DiagnosticThreadNameFilter - true - - - encoding-filter - hudson.util.CharacterEncodingFilter - true - - - uncaught-exception-filter - org.kohsuke.stapler.UncaughtExceptionFilter - true - - - authentication-filter - hudson.security.HudsonFilter - true - - - csrf-filter - hudson.security.csrf.CrumbFilter - true - - - error-attribute-filter - jenkins.ErrorAttributeFilter - true - - - plugins-filter - hudson.util.PluginServletFilter - true - - - - - - suspicious-request-filter - /* - - - diagnostic-name-filter - /* - - - encoding-filter - /* - - - uncaught-exception-filter - /* - - - authentication-filter - /* - - - csrf-filter - /* - - - error-attribute-filter - /* - - - plugins-filter - /* - - - - - jenkins.util.SystemProperties$Listener - - - hudson.WebAppMain - - - jenkins.JenkinsHttpSessionListener - - - - - admin - - - user - - - hudson - - - - - Hudson - /loginEntry - - - - ** - - - - - - - Disable TRACE - /* - TRACE - - - - - - - other - /* - - - - - - FORM - - /login - /loginError - - - - - - xml - application/xml - - - - log - text/plain - - - war - application/octet-stream - - - ear - application/octet-stream - - - rar - application/octet-stream - - - webm - video/webm - - - - java.lang.Throwable - /oops - - - 404 - /404 - - - - - - true - - - From 25a6a84d8796d4f132f9e9fbed760bb71b618eab Mon Sep 17 00:00:00 2001 From: Vincent Latombe Date: Fri, 31 Jan 2025 10:56:13 +0100 Subject: [PATCH 2/3] Update jetty plugin configuration for configuration discovery * Remove core classes from extra classpath, as when running `mvn -pl war jetty:run` it automatically gets added. --- war/pom.xml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/war/pom.xml b/war/pom.xml index 91cd5225abc3..1e78b07c4a38 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -691,12 +691,9 @@ THE SOFTWARE. com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl - - ${project.basedir}/../core/src/main/resources,${project.basedir}/../core/target/classes,${project.build.directory}/support-log-formatter.jar + + ${project.build.directory}/support-log-formatter.jar ${contextPath} - false - - NONE From 796a5579979fcb27e5ef7a4927d81a8f43179c06 Mon Sep 17 00:00:00 2001 From: Vincent Latombe Date: Fri, 31 Jan 2025 11:46:34 +0100 Subject: [PATCH 3/3] Only need to scan core jar --- war/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/war/pom.xml b/war/pom.xml index 1e78b07c4a38..3d6705835e24 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -694,6 +694,7 @@ THE SOFTWARE. ${project.build.directory}/support-log-formatter.jar ${contextPath} + .*(jenkins-core|target/classes).*