apache / apache/maven-remote-resources-plugin

[MRRESOURCES-71] Replace properties in file and directory names during resource bundle processing

Open
#117 0 comments 0 reactions 0 assignees View on GitHub
enhancement priority:minor
Dominant language
Java
Stars
17
Forks
18
Avg merge
6h 5m
Merged PRs (30d)
5

Description

**[Fabien Crespel](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=fcrespel)** opened **[MRRESOURCES-71](https://issues.apache.org/jira/browse/MRRESOURCES-71?redirect=false)** and commented

To make resource bundles more useful in the context of the project in which they are processed, **property placeholders** in **file and directory names** should be replaced by their value. For example, the resource bundle could contain a directory named `\_\_artifactId\_\_`, which would be replaced by the actual artifactId of the project using this bundle as part of the `process-remote-resources` goal. My personal use case is for making a Tomcat CATALINA_BASE resource bundle, which I could optionally use in J2EE-based projects for easier "standalone" packaging.

The attached patch adds this simple new feature to `ProcessRemoteResourcesMojo`, and is based on the work done in the [archetype plugin](http://grepcode.com/file/repo1.maven.org/maven2/org.apache.maven.archetype/archetype-common/2.2/org/apache/maven/archetype/generator/DefaultFilesetArchetypeGenerator.java#DefaultFilesetArchetypeGenerator.replaceFilenameTokens%28java.lang.String%2Corg.apache.maven.archetype.generator.Context%29). I have successfully tested it on some of my projects, but haven't made a proper testcase yet (waiting for feedback first).

Please let me know what you think of this and whether it could be included in the current trunk. :)

---

**Affects:** 1.6.0

**Attachments:**
- [ProcessRemoteResourcesMojo.java.patch](https://issues.apache.org/jira/secure/attachment/12718302/ProcessRemoteResourcesMojo.java.patch) (_3.58 kB_)

**Issue Links:**
- [MRRESOURCES-102](https://issues.apache.org/jira/browse/MRRESOURCES-102) Filtering of non-.vm files
(_**"is duplicated by"**_)

Contributor guide

No contributing guide indexed for this repository

Research direction

Read ProcessRemoteResourcesMojo and the attached ProcessRemoteResourcesMojo.java.patch first, then check MRRESOURCES-102 because this report is marked duplicated by it. Done means resource-bundle processing replaces placeholders in file and directory names and the behavior has a proper testcase.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.