-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add Maven Build Cache plugin #4919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
9109c15 to
6f97a7b
Compare
sobychacko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ericbottard It might be beneficial if you could amend the commit message to include some context about these components to reflect what these changes entail, how they are supposed to work, and help with the build process etc.
6f97a7b to
1868e14
Compare
Done, I hope this is the kind of explanation you were looking for. I intend to demo how the extension works this week, but you can always read more at https://maven.apache.org/extensions/maven-build-cache-extension/index.html |
97b38c7 to
c496d2f
Compare
The build cache extension caches the results of maven goal executions and skips re-running them if the same inputs are detected again. This helps both local development (re run tests of affected modules only) and CI builds eventually (a subsequent commit will introduce sharing of the cache between CI runs) Signed-off-by: Eric Bottard <eric.bottard@broadcom.com>
c496d2f to
9fe7732
Compare
| # | ||
| distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip | ||
| distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.1/apache-maven-3.9.1-bin.zip | ||
| wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall we update to https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/ @ericbottard ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? Should we also update the wrapper version?
Doesn't matter for build-cache, but why not.
The maven version was updated by the PR you just merged anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, update the wrapper version.
| <reconcile propertyName="skip" skipValue="true"/> | ||
| <reconcile propertyName="skipExec" skipValue="true"/> | ||
| <reconcile propertyName="skipTests" skipValue="true"/> | ||
| <reconcile propertyName="testFailureIgnore" skipValue="true"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mr. claude said this could be dangerous.
When testFailureIgnore=true:
Surefire still executes every test
Test reports are written to target/surefire-reports/
Code coverage data is generated
Any test-triggered side effects happen
The only difference is that a failing test won't fail the build.
The dangerous scenario
Imagine this sequence:
First build: testFailureIgnore=false, tests run, results cached
Second build: testFailureIgnore=true, cache says "this is a skip flag, reuse cached result"
Result: Tests never actually ran on the second build, but Maven thinks they did
You'd get stale test reports, potentially miss new test failures entirely, and have no idea tests were skipped.
|
removed the |
Thank you for taking time to contribute this pull request!
You might have already read the contributor guide, but as a reminder, please make sure to:
git commit -s) per the DCOmainbranch and squash your commitsFor more details, please check the contributor guide.
Thank you upfront!