Enable build caching using develocity - #27163
Conversation
| <develocity> | ||
| <buildCache> | ||
| <local> | ||
| <enabled>#{isFalse(env['CI'])}</enabled> |
There was a problem hiding this comment.
Tested with:
CI=true mvn clean install -P quick-build
Caching no longer occurs
| <extension> | ||
| <groupId>com.gradle</groupId> | ||
| <artifactId>develocity-maven-extension</artifactId> | ||
| <version>2.5.0</version> |
There was a problem hiding this comment.
License appears to be: https://develocity.ai/legal/gradle-technologies-terms-of-use/
any thoughts?
We aren't bundling it, it just provides faster builds.
If its a dealbreaker I can go back to trying to get the apache one to work but this was a lot simpler
There was a problem hiding this comment.
any thoughts?
Gradle shared Develocity build caching with me and some others a while ago. They indicated that it has significantly reduced build times for those Apache projects that use it. I think we should use it. They intend for it to be used by open source projects, as far as I can tell.
There was a problem hiding this comment.
Pull request overview
This pull request introduces Develocity’s Maven extension and configuration to enable build caching for local development builds, and updates the parent POM version.
Changes:
- Add
com.gradle:develocity-maven-extensionto Maven core extensions. - Add
.mvn/develocity.xmlto enable the local build cache (currently gated by environment). - Ignore Develocity’s local state directory under
.mvn/.develocity/, and bump the parent POM version.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pom.xml | Updates the parent POM version (potentially broad impact beyond caching). |
| .mvn/extensions.xml | Adds the Develocity Maven extension to enable build caching features. |
| .mvn/develocity.xml | Configures Develocity build cache enablement logic. |
| .gitignore | Ignores Develocity’s local directory under .mvn/.develocity/. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
.mvn/develocity.xml:10
<onlyIf>false</onlyIf>disables build scan publishing unconditionally, so running Maven with-Dscan(as the comment suggests) will still never publish a scan. If the intent is “publish only when -Dscan is provided”, makeonlyIfconditional on the presence of thescansystem property.
<!-- if you want a build scan, pass -Dscan on the command line -->
<onlyIf>false</onlyIf>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
.mvn/develocity.xml:10
- The comment says scans can be enabled with
-Dscan, butonlyIfis currently hard-coded tofalse, so build scans will never be published even when-Dscanis passed. Use a property-based condition so the comment matches the behavior.
<!-- if you want a build scan, pass -Dscan on the command line -->
<onlyIf>false</onlyIf>
MarkEWaite
left a comment
There was a problem hiding this comment.
Saves time on my build as well.
This PR is now ready for merge. We will merge it after approximately 24 hours if there is no negative feedback. Please see the merge process documentation for more information about the merge process.
/label ready-for-merge
Generated with core pull request: * jenkinsci/jenkins#27206 Includes pull requests: * jenkinsci/jenkins#27205 * jenkinsci/jenkins#27201 * jenkinsci/jenkins#27193 * jenkinsci/jenkins#27163 * jenkinsci/jenkins#27088 * jenkinsci/jenkins#27083 * jenkinsci/jenkins#27067 * jenkinsci/jenkins#27065 * jenkinsci/jenkins#27063 * jenkinsci/jenkins#27032 * jenkinsci/jenkins#26923 * jenkinsci/jenkins#26922 * jenkinsci/jenkins#26913 * jenkinsci/jenkins#26880 * jenkinsci/jenkins#26690 * jenkinsci/jenkins#26668 * jenkinsci/jenkins#26600 * jenkinsci/jenkins#26587 * jenkinsci/jenkins#11216 * jenkinsci/jenkins#10432 * jenkinsci/jenkins#8559
This enables local build caching for the built-in supported goals. Primary benefit is caching of compilation for modules, especially the CLI module.
Savings seem worth it to me, works well in my testing.
Note
Requires #27162 for the biggest benefit
A full build using cache and
mvnd:Note
Homebrews latest version of
mvnd(1.0.2) doesn't support develocityGrab a newer one from GitHub releases
Full build using cache and plain
mvn:Fixes #
Testing done
mvn jetty:runI also tried https://maven.apache.org/extensions/maven-build-cache-extension/ but it wasn't working with
jetty:runScreenshots (UI changes only)
Before
After
Proposed changelog entries
Proposed changelog category
/label
Proposed upgrade guidelines
N/A
Submitter checklist
@Restrictedor have@since TODOJavadocs, as appropriate.@Deprecated(since = "TODO")or@Deprecated(forRemoval = true, since = "TODO"), if applicable.evalto ease future introduction of Content Security Policy (CSP) directives (see documentation).Desired reviewers
@mention
Before the changes are marked as
ready-for-merge:Maintainer checklist
upgrade-guide-neededlabel is set and there is a Proposed upgrade guidelines section in the pull request title (see example).lts-candidateto be considered.