Skip to content

enhancement request: <filters> support #118

@Farmbuyer

Description

@Farmbuyer

There's a feature that maven-resources-plugin supports that this plugin does not, and I'd like to make a request for adding it. Specifically, the <filters> element, for handling replacement strings that can't be easily captured in XML, or are generated during the build, etc.

The current code (line 196, the "copy permalink" action on github doesn't work in firefox) is simply passing an empty list. Looking at the call destination...

https://github.com/apache/maven-filtering/blob/master/src/main/java/org/apache/maven/shared/filtering/MavenResourcesExecution.java line 139

...and its parent...

https://github.com/apache/maven-filtering/blob/master/src/main/java/org/apache/maven/shared/filtering/AbstractMavenFilteringRequest.java

...it looks like support in templating-maven-plugin would only ("only") require a similar

@Parameter
protected List<String> filters;

plus initialization to a non-null empty-but-still-mutable list using whatever coding style this plugin prefers, and then passing that filters member instead of the first emptyList() call. The AbstractMavenFilteringRequest logic handles the rest, if I'm reading it correctly.

I wrote "only" above because there would obviously still need to be testing and documentation, and I'm not familiar enough with the github and maven and plugin development to usefully do anything there. Clearly adding support for the <filters> feature would not be as trivial as I'm handwaving it to be, but I'd like to think the request isn't out of line.

(Alternatively, if there's some existing equivalent way of getting an external <filter>the/path/to/a/filter.properties</filter> working with templating-maven-plugin, I'd love to use it. Would be much nicer than maven-resources-plugin to do the replacements, followed by build-helper-maven-plugin to attach the generated source.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions