simonetallevi / maven-replacer-plugin

Automatically exported from code.google.com/p/maven-replacer-plugin
MIT License
0 stars 0 forks source link

Specification of default symbol for the begin and end of a token #44

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Using a <tokenValueMap> in configuration
2. For readability each token in the resource files is surrounded with '${' and 
'}' for instance (or '$'s for simplicity).
3. Every token in the map file needs to be surrounded as well. This overhead 
does not support a quick and easy maintenance.

What is the expected output? What do you see instead?
I thought about the configuration like this:

<delimiters>
  <delimiter>${*}</delimiter>
  <delimiter>@</delimiter>
</delimiters>

I found it in well known plugin: 
http://maven.apache.org/plugins/maven-resources-plugin/resources-mojo.html#delim
iters

Maybe the same syntax can be used to define delimiters for your great plugin.

What version of the product are you using? On what operating system?
1.3.5

Please provide any additional information below.

Original issue reported on code.google.com by r0bb3n.h...@googlemail.com on 10 Jan 2011 at 5:38

GoogleCodeExporter commented 9 years ago
Thanks for the suggestion. I'll have a look into this.
-- Steven

Original comment by baker.st...@gmail.com on 10 Jan 2011 at 10:48

GoogleCodeExporter commented 9 years ago

Original comment by baker.st...@gmail.com on 16 Jan 2011 at 1:33

GoogleCodeExporter commented 9 years ago
Finished development for this Issue and it will be in next release if there are 
no problems with it.

You can test it if you'd like by following the InstallationGuide and/or 
reviewing the test project's source at: 
http://code.google.com/p/maven-replacer-plugin/source/browse/#svn%2Ftest-plugin-
use

I hope this helps,
-- Steven

Original comment by baker.st...@gmail.com on 17 Jan 2011 at 10:05

GoogleCodeExporter commented 9 years ago
I just published a release candidate under version 1.3.6-RC1 if you would like 
to try it (currently waiting for it to be processed with Sonatype).

-- Steven

Original comment by baker.st...@gmail.com on 17 Jan 2011 at 10:44

GoogleCodeExporter commented 9 years ago
Note: delimiters in the format ${*} need to be set as $${*} in the 
configuration.
This is because ${...} is the format for a maven property and maven will 
attempt to use a property rather than the literal value if you don't escape it 
with a prefixing $.

Original comment by baker.st...@gmail.com on 17 Jan 2011 at 10:46

GoogleCodeExporter commented 9 years ago
Thanks in advance for treating this issue so fast.
For uncritical delimiter it works fine. Since I configure the plugin as follows
   <configuration>
     <delimiters>
       <delimiter>$${*}</delimiter>
     </delimiters>
     ...
   <configuration>
the following error occures:
   [ERROR] Failed to execute goal com.google.code.maven-replacer-plugin:maven-replacer-plugin:1.3.6-RC1:replace (default) on project moduleB: Execution default of goal com.google.code.maven-replacer-plugin:maven-replacer-plugin:1.3.6-RC1:replace failed: Illegal repetition near index 0
   [ERROR] ${B}
   [ERROR] ^
   [ERROR] -> [Help 1]
   [ERROR] 
   [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
   [ERROR] Re-run Maven using the -X switch to enable full debug logging.
   [ERROR] 
   [ERROR] For more information about the errors and possible solutions, please read the following articles:
   [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

My token value map file looks like this:
B=b
and the resource file like this:
a${B}cde

I hope this description helps to understand my problem. 

-- Robin

Original comment by r0bb3n.h...@googlemail.com on 19 Jan 2011 at 9:42

GoogleCodeExporter commented 9 years ago
Hi Robin,

Are you setting <regex>false</regex> in your configuration?

Sorry, I should have been more clear in this. But the $ symbol would be 
processed as a regexp character otherwise.

I hope this resolves the issue for you,
-- Steven

Original comment by baker.st...@gmail.com on 19 Jan 2011 at 10:10

GoogleCodeExporter commented 9 years ago
I set this configuration now and of course it works great.

Thanks.
-- Robin

Original comment by r0bb3n.h...@googlemail.com on 19 Jan 2011 at 10:42

GoogleCodeExporter commented 9 years ago
Just issue clean up.

Original comment by baker.st...@gmail.com on 17 Sep 2012 at 12:45