From 31d8fbb731153ab312ee7252ce4afc4274222149 Mon Sep 17 00:00:00 2001
From: Tim Jacomb <21194782+timja@users.noreply.github.com>
Date: Wed, 5 Aug 2026 21:50:15 +0100
Subject: [PATCH] Add more to quick-build, remove cleaning node_modules
(#27161)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
74.4s → 45.0s (39% faster)
---
CONTRIBUTING.md | 16 ++++++-
core/pom.xml | 1 +
pom.xml | 112 ++++++++++++++++++++++++++++++++++++++++++------
3 files changed, 116 insertions(+), 13 deletions(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 700b2b0de4..8e3fba0624 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -35,6 +35,20 @@ mvn -am -pl war,bom -Pquick-build clean install
```
The WAR file will be created in `war/target/jenkins.war`.
+
+> [!NOTE]
+> `quick-build` sets `maven.test.skip`, so test classes are not compiled and are not present
+> afterwards. To build something you can then run tests against, drop the profile or pass
+> `-Dmaven.test.skip=false`.
+
+`clean` deliberately leaves `node/`, `node_modules/` and `.yarn/` in place, so the node
+toolchain and the downloaded packages survive between builds. Pass `-Dclean.node` to delete
+those as well.
+
+If you are only changing backend code and `war/src/main/webapp/jsbundles` is already populated
+from an earlier build, `-Dskip.frontend=true` skips the node installation, `yarn install` and
+`yarn build`.
+
After that, you can start Jenkins using Java CLI ([guide](https://www.jenkins.io/doc/book/installing/war-file/#run-the-war-file)).
If you want to debug the WAR file without using Maven plugins,
You can run the executable with [Remote Debug Flags](https://stackoverflow.com/questions/975271/remote-debugging-a-java-application)
@@ -74,7 +88,7 @@ To work on the `war` module frontend assets, two processes are needed at the sam
On one terminal, start a development server that will not process frontend assets:
```sh
-MAVEN_OPTS='--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED' mvn -pl war jetty:run -Dskip.yarn
+MAVEN_OPTS='--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED' mvn -pl war jetty:run -Dskip.frontend
```
Open another terminal and start a [webpack](https://webpack.js.org/) dev server, after [optionally adding Node and Yarn to your path](#running-the-yarn-frontend-build):
diff --git a/core/pom.xml b/core/pom.xml
index 0b4bcaa23f..922b0262cb 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -662,6 +662,7 @@ THE SOFTWARE.
prepare-package
+ ${strip.license.comments.skip}
diff --git a/pom.xml b/pom.xml
index f647489fde..07020e7da0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -97,6 +97,12 @@ THE SOFTWARE.
1.32
false
false
+
+ false
+
+ false
8.1044.v8e30078854c2
24.18.0
@@ -404,6 +410,49 @@ THE SOFTWARE.
https://www.jenkins.io/changelog-stable
+
+
+ quick-build
+
+
+ true
+ true
+
+ true
+
+
+
+
+
+ io.jenkins.tools.maven
+ license-maven-plugin
+
+
+
+
+ default
+ none
+
+
+
+
+
+
+
yarn-execution
@@ -427,6 +476,7 @@ THE SOFTWARE.
v${node.version}
https://repo.jenkins-ci.org/nodejs-dist/
+ ${skip.frontend}
@@ -437,6 +487,7 @@ THE SOFTWARE.
initialize
yarn install
+ ${skip.frontend}
@@ -447,6 +498,7 @@ THE SOFTWARE.
generate-sources
yarn build
+ ${skip.frontend}
@@ -456,19 +508,15 @@ THE SOFTWARE.
maven-clean-plugin
+
-
- .yarn
- false
-
-
- node
- false
-
-
- node_modules
- false
-
war/src/main/webapp/jsbundles
false
@@ -557,6 +605,46 @@ THE SOFTWARE.
+
+
+ clean-node
+
+
+ clean.node
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-clean-plugin
+
+
+
+
+
+ war/src/main/webapp/jsbundles
+ false
+
+
+ .yarn
+ false
+
+
+ node
+ false
+
+
+ node_modules
+ false
+
+
+
+
+
+
+
disable-symlink-tests