You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Filtering of overlapping <resource> entries regressed between 3.3.1 and 3.3.2 #333
maven-filtering 3.3.2 and later (3.3.2, 3.4.0, 3.5.0). Last known-good: 3.3.1.
Summary
When a single source directory is covered by two <resource> entries:
one with filtering=true plus a narrow <include>, the other with filtering=false plus <include>**</include>; the file selected by the
first entry is no longer filtered. The placeholder is left as the literal ${...} text instead of being replaced.
This was first reported downstream against maven-resources-plugin in apache/maven-resources-plugin#471. Bisecting the maven-resources-plugin history shows the regression entered with 493aa46, a one-line dependency bump from maven-filtering 3.3.1 → 3.3.2, with no source change in the plugin itself.
The root cause therefore lives here, in maven-filtering.
Reproducer
A self-contained JUnit test that exercises MavenResourcesFiltering
directly is available on a branch:
When two entries cover the same source directory, DefaultMavenResourcesFiltering processes them in
declaration order. With the old copyFile(..., overwrite) API, the first (filtered) entry wrote the file with overwrite=true, then the second (unfiltered) entry wrote the raw source and would only overwrite if overwrite=true. After this commit, every write happens unconditionally through CachingOutputStream; so th second entry's raw copy clobbers the first entry's filtered output, leaving the literal ${repro.value} on disk.
Put another way: 3.3.1's overwrite flag let the first writer "win" for files explicitly included in a filtered entry. 3.3.2 lost that distinction by collapsing the API.
Activity
rzo1 commentedon May 5, 2026
FYI: A bisect leads to: 1371dcf
When two entries cover the same source directory, DefaultMavenResourcesFiltering processes them in
declaration order. With the old copyFile(..., overwrite) API, the first (filtered) entry wrote the file with overwrite=true, then the second (unfiltered) entry wrote the raw source and would only overwrite if overwrite=true. After this commit, every write happens unconditionally through CachingOutputStream; so th second entry's raw copy clobbers the first entry's filtered output, leaving the literal ${repro.value} on disk.
Put another way: 3.3.1's overwrite flag let the first writer "win" for files explicitly included in a filtered entry. 3.3.2 lost that distinction by collapsing the API.