prafulljha / maven-replacer-plugin

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

tokenValueMap not relative to pom like other files #53

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Define a tokenValueMap to point to a file location relative to the pom. 
Example: 
"<tokenValueMap>src/main/config/replacements.properties</tokenValueMap>".
2. Run the target to confirm that it worked when running from that pom.
3. Run the target from the parent pom.

What is the expected output? What do you see instead?

The file is found for the tokenValueMap when running from the pom. However, 
running it from the parent does not treat the path as relative like it does for 
the source/output files. The tokenValueMap should be treated the same.

What version of the product are you using?
plug-in version 1.3.7

Please provide any additional information below.
The tokenValueMap file path should be treated the same as all of the others. 
Also, there needs to be more examples for this file parameter, or the tokenFile 
(what should this look like). The ignoreMissingFile flag should also apply to 
the tokenValueMap file as well.

Original issue reported on code.google.com by doraz1...@gmail.com on 14 Jul 2011 at 7:25

GoogleCodeExporter commented 9 years ago
Hi doraz,

Thanks for reporting this. I will look into this soon.

I'm not sure about "The ignoreMissingFile flag should also apply to the 
tokenValueMap file as well." - I'll have to think on that one.

I will also look into making more examples for the tokenValueMap.

Thanks again,

Steven

Original comment by baker.st...@gmail.com on 14 Jul 2011 at 11:55

GoogleCodeExporter commented 9 years ago
Hi Steven,

I found a work-around for this problem by adding
"${project.build.directory}/../" before the path to my tokenValueMap. If you
don't think the "ignoreMissingFile" element should be used for the
tokenValueMap, maybe consider a new parameter.

My situation is that we are using this to customize a configuration for our
application. If a developer wants to use the default configuration, the file
defined in tokenValueMap is empty. It would be better if the file did not
have to exist, but the entry can still exist in the pom. This can be a
future feature, but I thought I would bring it up at this time.

Thanks again,
Steve

Original comment by doraz1...@gmail.com on 15 Jul 2011 at 3:06

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I have completed the code change for the tokenValueMap file missing the base 
dir prefix. This will be ready in the next release: 1.3.9. 

If you're keen to try it earlier, you can check-out and build this plugin from 
the source. (See InstallationGuide for more details).
However, this version does not have the ignoring of missing tokenValueMap 
files. You could always modify the source (see ReplacerMojo.java around where 
ignore missing file is implemented).

I think I will end up adding another parameter for this function rather than 
re-use the ignoreMissingFile parameter as that would be a existing 
functionality change. Adding a new parameter would be better for people 
upgrading without having to change their configuration. However, I am sure you 
understand why I would be hesitant in adding new parameters due to the now 
significant amount of exist parameters. (You just have to look at the 
UsageGuide page). 
I shall implement this change in a separate Issue.

Original comment by baker.st...@gmail.com on 19 Jul 2011 at 6:15

GoogleCodeExporter commented 9 years ago
Just issue clean up.

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