Conversation
Reviewer's GuideAdds Maven Build Cache Extension 1.3.0 and repository configuration that reuses unchanged module outputs while preserving required generated directories and bypassing cache restoration for Takari lifecycle execution. The Maven wrapper requirement is expected to be Maven 3.9.12 or newer; caching is enabled by default and can be disabled via the documented Maven property. Flow diagram for cached Maven module buildsflowchart TD
Start["Maven build"] --> Enabled{"Cache enabled?"}
Enabled -->|No| Build["Compile modules normally"]
Enabled -->|Yes| Lookup["Check module build cache"]
Lookup --> Hit{"Unchanged module?"}
Hit -->|Yes| Restore["Restore cached outputs"]
Hit -->|No| Compile["Compile changed module"]
Compile --> Save["Store module outputs in cache"]
Restore --> Done["Continue build"]
Save --> Done
Build --> Done
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".mvn/maven-build-cache-config.xml" line_range="6" />
<code_context>
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/BUILD-CACHE/1.0.0 http://maven.apache.org/xsd/build-cache-1.0.0.xsd">
+ <configuration>
+ <enabled>true</enabled>
+ <hashAlgorithm>XX</hashAlgorithm>
+ <attachedOutputs>
</code_context>
<issue_to_address>
**issue (bug_risk):** The documented opt-out command `-Dmaven.build.cache.enabled=true` does not disable the cache because the configuration enables it with `true`; users following the instructions still run with build caching enabled.
**Triggers:** When a developer encounters a cache-related build failure and follows the documented disable command.
**Suggested fix:** Change the documented property value to `-Dmaven.build.cache.enabled=false` and verify that the extension property overrides this configuration value.
</issue_to_address>
### Comment 2
<location path=".mvn/extensions.xml" line_range="13-17" />
<code_context>
</extension>
+ <extension>
+ <groupId>org.apache.maven.extensions</groupId>
+ <artifactId>maven-build-cache-extension</artifactId>
+ <version>1.3.0</version>
+ </extension>
</extensions>
</code_context>
<issue_to_address>
**issue (bug_risk):** Adding this extension makes the build require Maven 3.9.0 or newer before Maven can load the project, while the repository documentation still advertises Maven 3.6.3+ and users invoking system `mvn` with that version will fail before the build starts.
**Triggers:** When a developer uses the documented Maven 3.6.3–3.8.x system installation instead of the updated wrapper.
**Suggested fix:** Either preserve compatibility with the documented Maven versions, update the minimum Maven requirement/documentation, or ensure the build consistently requires and invokes the Maven wrapper.
```suggestion
```
</issue_to_address>Maven build cache is an extension that allows caching non changing modules, speeding up subsequent builds. This will help reducing local build time during development for developers, especially for the ones with low-end/older machines. - Added maven build cache extension - Added build cache config Build time comparision: - Hardware: nmve, i71165G7, 16 GB@3200Mhz - Software: fedora workstation 44, maven 3.9.11, temurin-17-jdk - Build command: `mvn install/compile -DskipTests -pl '!presto-docs'` No code changes in neither case ``` +------------+----------+---------+ | Operation | no cache | cache | +------------+----------+---------+ | install | 5:02 min | 26.438 s| +------------+----------+---------+ | compile | 50:419 s | 17.590 s| +------------+----------+---------+ ``` When there are changes in a module, only that module is recompiled. Issues addressed in the cache configuration: - `dirNames` to avoid `clean install` on cached build to remove target data - Added custom execution control to avoid build errors due to interference between takari build system and maven build cache The maven build cache plugin requires maven 3.9.0, but the projects maven wrapper has been updated to 3.9.12 (prestodb#27030) In case of issues, maven build cache can be disabled with: `-Dmaven.build.cache.enabled=false` This will make compilation the same as before this patch ``` == NO RELEASE NOTE == ```
a89dfcb to
b9a09d0
Compare
|
Maven build cache is an extension that allows caching non changing modules, speeding up subsequent builds. This will help reducing local build time during development for developers, especially for the ones with low-end/older machines.
Build time comparision:
mvn install/compile -DskipTests -pl '!presto-docs'No code changes in neither case
When there are changes in a module, only that module is recompiled.
Issues addressed in the cache configuration:
dirNamesto avoidclean installon cached build to remove target dataThe maven build cache plugin requires maven 3.9.0, but the projects maven wrapper has been updated to 3.9.12
(#27030)
In case of issues, maven build cache can be disabled with:
-Dmaven.build.cache.enabled=falseThis will make compilation the same as before this patch
Description
Motivation and Context
Impact
Test Plan
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.
If release note is NOT required, use: