gnodet commented on code in PR #395:
URL: https://github.com/apache/maven-filtering/pull/395#discussion_r4095002970
##########
src/main/java/org/apache/maven/shared/filtering/DefaultMavenResourcesFiltering.java:
##########
@@ -363,6 +366,30 @@ static boolean isPropertiesFile(Path file) {
return
"properties".equals(getExtension(file.getFileName().toString()));
}
+ /**
+ * Returns {@code true} if the given relative file path matches any of the
provided
+ * Ant-style glob patterns, meaning the file should NOT be filtered.
+ *
+ * @param relativePath the file path relative to the resource directory
(forward-slash separated)
+ * @param nonFilteredGlobs the list of glob patterns from {@link
Resource#getNonFilteredFiles()},
+ * or {@code null} / empty if none
+ * @return {@code true} if the path matches at least one pattern
+ * @since 3.4.0
+ */
+ static boolean matchesNonFilteredGlob(String relativePath, List<String>
nonFilteredGlobs) {
+ if (nonFilteredGlobs == null || nonFilteredGlobs.isEmpty()) {
+ return false;
+ }
+ // Normalize separators — plexus SelectorUtils expects forward slashes
+ String normalizedPath = relativePath.replace('\\', '/');
+ for (String glob : nonFilteredGlobs) {
+ if (SelectorUtils.matchPath(glob.replace('\\', '/'),
normalizedPath, false)) {
Review Comment:
Not changed — keeping `false` (case-insensitive) intentionally. The existing
`filteredFileExtension` path already does case-insensitive matching
(`getExtension` uses `.toLowerCase(Locale.ROOT)`). Making glob matching
case-sensitive while extension matching is case-insensitive would create a
surprising inconsistency. Users specifying `**/*.p12` reasonably expect it to
also exclude `file.P12` on Linux, just as the extension-based exclusions do.
Cross-platform consistency is the right behaviour for this feature.
##########
src/main/java/org/apache/maven/shared/filtering/MavenResourcesExecution.java:
##########
@@ -464,6 +475,29 @@ private <T> List<T> copyList(List<T> lst) {
}
}
+ /**
+ * Returns whether files that cannot be filtered due to charset decoding
errors are silently
+ * copied as binary instead of failing the build.
Review Comment:
Fixed in 1219140: updated the Javadoc to say "copied as-is with a WARN log
entry" instead of "silently".
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]