feat: expose gracefulBinaryHandling parameter - #536
Merged
Merged
Conversation
gnodet-bot
reviewed
Sep 30, 2026
gnodet-bot
left a comment
There was a problem hiding this comment.
Solid feature — clean wiring, good IT coverage, sane default. One tag needs fixing.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
rmannibucau
approved these changes
Sep 30, 2026
- Add gracefulBinaryHandling parameter (default: false) that silently copies binary files triggering MalformedInputException instead of failing the build; a WARN log is emitted for each skipped file - Surfaces maven-filtering's gracefulBinaryHandling option previously inaccessible from maven-resources-plugin - Add @SInCE 3.4.0 javadoc tag and integration test coverage
gnodet
force-pushed
the
feat/graceful-binary-handling
branch
from
September 30, 2026 12:40
c522054 to
0b4ba4a
Compare
gnodet-bot
approved these changes
Sep 30, 2026
gnodet-bot
left a comment
There was a problem hiding this comment.
Re-reviewed after c522054. Both previous findings addressed:
@sincetag — fixed to4.0.0-beta-2✅- "silently skipped" wording — removed contradictory "silently" ✅
Clean feature: one @Parameter boolean wired to MavenResourcesExecution, good Javadoc with appropriate caveats, solid IT covering both the binary pass-through and text filtering. No issues.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
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.
Summary
Exposes
maven-filtering'sgracefulBinaryHandlingoption that was previously inaccessible frommaven-resources-plugin.When set to
true, binary files that trigger aMalformedInputExceptionduring filtering (i.e. unreadable as text in the configured charset) are silently copied as-is instead of failing the build. AWARNlog is emitted for each skipped file, pointing users toward the preferred targeted approaches.Configuration
Or via property:
-Dmaven.resources.gracefulBinaryHandling=trueGuidance
This is a last-resort fallback for heterogeneous resource directories where it is not practical to enumerate every binary extension. Prefer the targeted approaches:
<nonFilteredFileExtensions>— extension-based, mojo-level<nonFilteredFiles>inside a<resource>block — glob-based, per-resource (see PR feat: expose per-resource nonFilteredFiles glob patterns (MRESOURCES-521) #534)Changes
ResourcesMojo.java: new@Parameter(property = "maven.resources.gracefulBinaryHandling", defaultValue = "false")wired toMavenResourcesExecution.setGracefulBinaryHandling()MRESOURCES-graceful-binary: binary.p12in a filtered resource directory — build succeeds, binary copied byte-for-byte, text.propertiesfile filtered normally