You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "royteeuwen (via GitHub)" <gi...@apache.org> on 2026/07/30 14:15:53 UTC
[PR] Add includeHidden option to to opt hidden files back into cache input scanning [maven-build-cache-extension]
royteeuwen opened a new pull request, #519:
URL: https://github.com/apache/maven-build-cache-extension/pull/519
Closes #518
## Summary
Files/directories whose name starts with a dot are always treated as hidden and unconditionally skipped when scanning `<include>` paths for cache input files, with no way to override this. This is too broad for project layouts where meaningful, versioned content is stored in dotfile-named files by convention (e.g. Maven Filevault/JCR content packages, where a resource's definition typically lives in a file literally named `.content.xml`), making such content changes invisible to the cache.
## Change
Adds an `includeHidden` attribute (default `false`, fully backward compatible) to the `<include>` element, scoped per-include, so a specific include path can opt back into scanning hidden entries without affecting default behavior anywhere else.
## Testing
- Extended `MavenProjectInputTest` with two new unit tests (default still skips hidden files; `includeHidden="true"` collects them).
- Extended the existing `IncludeExcludeTest` end-to-end integration test fixture with a hidden-file scenario.
- Full test suite: `mvn clean install` (88/88 unit tests), `mvn verify -Prun-its` (333/333 IT tests) - all green, no regressions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add includeHidden option to to opt hidden files back into cache input scanning [maven-build-cache-extension]
Posted by "royteeuwen (via GitHub)" <gi...@apache.org>.
royteeuwen commented on code in PR #519:
URL: https://github.com/apache/maven-build-cache-extension/pull/519#discussion_r3701801285
##########
src/main/mdo/build-cache-config.mdo:
##########
@@ -951,6 +951,15 @@ under the License.
<type>String</type>
<description>Files in a directory are filtered by matching their names against this glob.</description>
</field>
+ <field xml.attribute="true">
Review Comment:
Bumped the modello model version from `1.3.0` to `1.4.0` in `pom.xml`, and updated the namespace/schemaLocation in `src/site/resources/maven-build-cache-config.xml` to match — following the same pattern as c915399 (the last model change). I left the existing test project configs on their current namespaces, as that commit did too.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add includeHidden option to to opt hidden files back into cache input scanning [maven-build-cache-extension]
Posted by "royteeuwen (via GitHub)" <gi...@apache.org>.
royteeuwen commented on PR #519:
URL: https://github.com/apache/maven-build-cache-extension/pull/519#issuecomment-5163095510
Thanks for the review @olamy — all three points addressed in fd8c5c5.
Verified locally: `mvn clean verify -Prun-its` → 88 unit tests and 333 ITs green (the 4 + 1 skips are pre-existing).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add includeHidden option to to opt hidden files back into cache input scanning [maven-build-cache-extension]
Posted by "royteeuwen (via GitHub)" <gi...@apache.org>.
royteeuwen commented on code in PR #519:
URL: https://github.com/apache/maven-build-cache-extension/pull/519#discussion_r3701800342
##########
src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java:
##########
@@ -428,15 +434,31 @@ private Path convertToAbsolutePath(Path path) {
*/
private void startWalk(
Path candidate, String glob, boolean recursive, List<Path> collectedFiles, Set<WalkKey> visitedDirs) {
+ startWalk(candidate, glob, recursive, false, collectedFiles, visitedDirs);
Review Comment:
Good point — removed the overload and updated the call sites to pass `includeHidden` explicitly.
##########
src/main/java/org/apache/maven/buildcache/checksum/WalkKey.java:
##########
@@ -28,11 +28,17 @@ public class WalkKey {
private final Path normalized;
private final String glob;
private final boolean recursive;
+ private final boolean includeHidden;
public WalkKey(Path normalized, String glob, boolean recursive) {
+ this(normalized, glob, recursive, false);
Review Comment:
Done — added `@Deprecated` plus a javadoc `@deprecated` tag pointing at the 4-arg constructor. Nothing in the codebase uses the 3-arg one anymore, so it is there purely for compatibility.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add includeHidden option to to opt hidden files back into cache input scanning [maven-build-cache-extension]
Posted by "olamy (via GitHub)" <gi...@apache.org>.
olamy commented on code in PR #519:
URL: https://github.com/apache/maven-build-cache-extension/pull/519#discussion_r3698768132
##########
src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java:
##########
@@ -428,15 +434,31 @@ private Path convertToAbsolutePath(Path path) {
*/
private void startWalk(
Path candidate, String glob, boolean recursive, List<Path> collectedFiles, Set<WalkKey> visitedDirs) {
+ startWalk(candidate, glob, recursive, false, collectedFiles, visitedDirs);
Review Comment:
no need to keep backward compat for private methods
##########
src/main/mdo/build-cache-config.mdo:
##########
@@ -951,6 +951,15 @@ under the License.
<type>String</type>
<description>Files in a directory are filtered by matching their names against this glob.</description>
</field>
+ <field xml.attribute="true">
Review Comment:
we usually increase model version in case of model changes (see pom.xml)
##########
src/main/java/org/apache/maven/buildcache/checksum/WalkKey.java:
##########
@@ -28,11 +28,17 @@ public class WalkKey {
private final Path normalized;
private final String glob;
private final boolean recursive;
+ private final boolean includeHidden;
public WalkKey(Path normalized, String glob, boolean recursive) {
+ this(normalized, glob, recursive, false);
Review Comment:
mark this constructor `deprecated`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add includeHidden option to to opt hidden files back into cache input scanning [maven-build-cache-extension]
Posted by "olamy (via GitHub)" <gi...@apache.org>.
olamy merged PR #519:
URL: https://github.com/apache/maven-build-cache-extension/pull/519
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org