Repository navigation
Skip resource filtering when no resources are configured - #520
Conversation
gnodet-bot
left a comment
There was a problem hiding this comment.
Thanks for the contribution — the idea is right (skip unnecessary work when no resources are configured). Two issues need to be addressed before this can be merged.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
gnodet-bot
left a comment
There was a problem hiding this comment.
All three findings from the previous review are addressed:
- verify.groovy — assertion now checks for the new
"No resources configured, skipping."log message, which is only emitted by the guard. Effective and distinguishes fixed from unfixed behavior. - invoker.properties — removed the incorrect
invoker.maven.version = 3.0+. The IT now inherits the project default, consistent with the other ITs in this repo. - ResourcesMojo.java — info log added in the early-return branch, matching the suggestion.
The guard correctly applies to all three mojo subclasses (ResourcesMojo, TestResourcesMojo, CopyResourcesMojo) via inheritance.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
gnodet-bot
left a comment
There was a problem hiding this comment.
New commit 2edcac1 fixes the IT to actually exercise the early-exit guard: without <resources /> in the POM, Maven's Super POM provides a default src/main/resources root, so getResources().isEmpty() was never true and the skip path was untested. With the explicit empty <resources />, the IT now correctly triggers the guard and asserts the skip message. All three findings from the initial review remain addressed.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
cae522e to
5db0624
Compare
…onfigured - Return early from ResourcesMojo when the resources list is empty or null - Add debug log message so the early exit is observable - Add integration test verifying no output is produced for empty resources
5db0624 to
ba47b5e
Compare
Summary
Avoid invoking the resource filtering component when the project has no resources configured. This prevents the misleading
Copying 0 resourcelog entry described in #311 while preserving normal filtering for configured resources.An integration fixture covers the empty-resource configuration and asserts that the zero-resource message is absent.
Fixes #311
Testing
mvn -Dspotless.skip=true -DskipTests=false test— passed (24 tests)git diff --check— passedmvn -Prun-its -Dinvoker.test=empty-resources -Dspotless.skip=true -DskipTests=false verify— blocked locally because Maven 3.9.16 does not satisfy this branch’s Maven 4.0.0-rc-6 prerequisiteSpotless was skipped because the repository formatter is not available for the local toolchain.