Conversation
…okens (MRESOURCES-162)
Add a new boolean parameter 'failOnMissingFilterValue' (default: false) that causes the
build to fail when a filter expression in a resource file cannot be resolved, instead of
silently passing the placeholder through as-is to the output.
Configuration:
<configuration>
<failOnMissingFilterValue>true</failOnMissingFilterValue>
</configuration>
Or via property:
-Dmaven.resources.failOnMissingFilterValue=true
The feature is implemented in maven-filtering (PR apache#408). This PR bumps
mavenFilteringVersion to 4.0.0-beta-2-SNAPSHOT and wires the new parameter
into MavenResourcesExecution.
Includes two ITs:
- MRESOURCES-162-fail: failOnMissingFilterValue=true causes BUILD FAILURE with
the unresolved token name in the error message
- MRESOURCES-162-pass: default behaviour (false) passes the placeholder through
Fixes: apache#400
gnodet
force-pushed
the
fix/mresources-162-fail-on-missing-filter-value
branch
from
September 26, 2026 20:47
7ba6232 to
ab13fd8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #400
Summary
Implements MRESOURCES-162: add a
failOnMissingFilterValueparameter that causes the build to fail when a filter expression in a resource file cannot be resolved, instead of silently leaving the placeholder in the output.Usage
Or via command line:
When enabled, a resource file containing
${missing.property}(wheremissing.propertyis not defined) will fail with:Changes
ResourcesMojo: addfailOnMissingFilterValue@Parameter(defaultfalse, backward compatible), wired intoMavenResourcesExecutionpom.xml: bumpmavenFilteringVersionto4.0.0-beta-2-SNAPSHOT(requires apache/maven-filtering#408)MRESOURCES-162-fail: verifies build fails with the unresolved token in the error messageMRESOURCES-162-pass: verifies default behavior (placeholder passed through as-is)Dependency
This PR depends on apache/maven-filtering#408 which implements the detection in the filter readers. The
mavenFilteringVersionwill be updated to the released version once that PR is merged and released.