diff --git a/.mvn/extensions.xml b/.mvn/extensions.xml index 1f36364094f1..a64ab6f242ca 100644 --- a/.mvn/extensions.xml +++ b/.mvn/extensions.xml @@ -1,4 +1,4 @@ - + io.jenkins.tools.incrementals git-changelist-maven-extension diff --git a/core/src/main/java/hudson/WebAppMain.java b/core/src/main/java/hudson/WebAppMain.java index 99603ac1e411..9f328328c710 100644 --- a/core/src/main/java/hudson/WebAppMain.java +++ b/core/src/main/java/hudson/WebAppMain.java @@ -48,6 +48,7 @@ import java.io.File; import java.io.IOException; import java.io.OutputStream; +import java.lang.reflect.InvocationTargetException; import java.net.URL; import java.net.URLClassLoader; import java.nio.charset.Charset; @@ -261,13 +262,36 @@ public void run() { new HudsonFailedToLoad(e).publish(context, _home); throw e; } catch (Exception e) { - new HudsonFailedToLoad(e).publish(context, _home); + // Allow plugins to override error page on boot with custom BootFailure subclass thrown + Throwable error = unwrapException(e); + if (error instanceof InvocationTargetException) { + Throwable targetException = ((InvocationTargetException) error).getTargetException(); + + if (targetException instanceof BootFailure) { + ((BootFailure) targetException).publish(context, _home); + } else { + new HudsonFailedToLoad(e).publish(context, _home); + } + } else { + new HudsonFailedToLoad(e).publish(context, _home); + } } finally { Jenkins instance = Jenkins.getInstanceOrNull(); if (!success && instance != null) instance.cleanUp(); } } + + private Throwable unwrapException(Exception e) { + Throwable error = e; + while (error.getCause() != null) { + if (error.getCause() instanceof InvocationTargetException) { + return error.getCause(); + } + error = error.getCause(); + } + return error; + } }; initThread.start(); } catch (BootFailure e) { diff --git a/core/src/main/resources/jenkins/install/platform-plugins.json b/core/src/main/resources/jenkins/install/platform-plugins.json index 15dd708447c7..62885083fbdd 100644 --- a/core/src/main/resources/jenkins/install/platform-plugins.json +++ b/core/src/main/resources/jenkins/install/platform-plugins.json @@ -94,6 +94,10 @@ { "name": "mailer", "suggested": true } ] }, + { + "category": "Appearance", + "plugins": [{ "name": "dark-theme", "suggested": true }] + }, { "category": "Languages", "plugins": [{ "name": "locale" }, { "name": "localization-zh-cn" }] diff --git a/test/src/test/java/hudson/slaves/JNLPLauncherTest.java b/test/src/test/java/hudson/slaves/JNLPLauncherTest.java index 813c72364558..e71b2fbcce9c 100644 --- a/test/src/test/java/hudson/slaves/JNLPLauncherTest.java +++ b/test/src/test/java/hudson/slaves/JNLPLauncherTest.java @@ -157,12 +157,21 @@ private ArgumentListBuilder buildJnlpArgs(Computer c) throws Exception { ArgumentListBuilder args = new ArgumentListBuilder(); args.add(new File(new File(System.getProperty("java.home")), "bin/java").getPath(), "-jar"); args.add(Which.jarFile(Launcher.class).getAbsolutePath()); - // TODO deprecated mode - args.add("-jnlpUrl", j.getURL() + "computer/" + c.getName() + "/jenkins-agent.jnlp"); + args.add("-url"); + args.add(j.getURL()); + args.add("-name"); + args.add(c.getName()); if (c instanceof SlaveComputer) { SlaveComputer sc = (SlaveComputer) c; + args.add("-secret"); + args.add(sc.getJnlpMac()); ComputerLauncher launcher = sc.getLauncher(); + if (launcher instanceof ComputerLauncherFilter) { + launcher = ((ComputerLauncherFilter) launcher).getCore(); + } else if (launcher instanceof DelegatingComputerLauncher) { + launcher = ((DelegatingComputerLauncher) launcher).getLauncher(); + } if (launcher instanceof JNLPLauncher) { args.add(((JNLPLauncher) launcher).getWorkDirSettings().toCommandLineArgs(sc)); } diff --git a/test/src/test/java/hudson/tasks/MavenTest.java b/test/src/test/java/hudson/tasks/MavenTest.java index bd366adce71d..58aefa2292fb 100644 --- a/test/src/test/java/hudson/tasks/MavenTest.java +++ b/test/src/test/java/hudson/tasks/MavenTest.java @@ -66,6 +66,7 @@ import org.jvnet.hudson.test.Issue; import org.jvnet.hudson.test.JenkinsRule; import org.jvnet.hudson.test.ToolInstallations; +import org.jvnet.hudson.test.recipes.WithTimeout; import org.kohsuke.stapler.jelly.JellyFacet; /** @@ -190,7 +191,7 @@ private void verify() throws Exception { assertNotNull(isp.installers.get(MavenInstaller.class)); } - @Test public void sensitiveParameters() throws Exception { + @Test @WithTimeout(300) public void sensitiveParameters() throws Exception { FreeStyleProject project = j.createFreeStyleProject(); ParametersDefinitionProperty pdb = new ParametersDefinitionProperty( new StringParameterDefinition("string", "defaultValue", "string description"),