Skip to content

Conversation

@ericbottard
Copy link
Member

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:

  • Add a Signed-off-by line to each commit (git commit -s) per the DCO
  • Rebase your changes on the latest main branch and squash your commits
  • Add/Update unit tests as needed
  • Run a build and make sure all tests pass prior to submission

For more details, please check the contributor guide.
Thank you upfront!

@ericbottard ericbottard force-pushed the build-cache-plugin branch 3 times, most recently from 9109c15 to 6f97a7b Compare November 21, 2025 15:21
@ericbottard ericbottard marked this pull request as ready for review November 21, 2025 15:23
Copy link
Contributor

@sobychacko sobychacko left a 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.

@ericbottard
Copy link
Member Author

@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.

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

@ilayaperumalg ilayaperumalg self-assigned this Nov 24, 2025
@ericbottard ericbottard force-pushed the build-cache-plugin branch 2 times, most recently from 97b38c7 to c496d2f Compare November 25, 2025 15:18
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>
#
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

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

Copy link
Member

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"/>
Copy link
Member

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.

@markpollack
Copy link
Member

removed the reconcile propertyName="testFailureIgnore" and update the wrapper to the latest. first build takes about 7 min on my laptop. merged in 147f85a

@markpollack markpollack closed this Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants