jmporterog / maven-replacer-plugin

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

Absolute path for tokenValueMap not working #60

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Write a simple pom.xml with an absolute path for tokenValueMap
2. Run mvn -am -pl <module>/<path> clean package

What is the expected output? What do you see instead?
Should use the absolute file as the tokenValueMap. 
It searches for the file under current directory and reports File Not Found. 

What version of the product are you using?
1.4.0

Please provide any additional information below.
Running on solaris.
Execution phase is process-sources.
I tried setting basedir to / but the problem is that it starts the 
fileToReplace search from the basedir too.

Original issue reported on code.google.com by sujay.co...@gmail.com on 29 Nov 2011 at 8:22

GoogleCodeExporter commented 9 years ago
Thanks Sujay, I will look into this soon.

Original comment by baker.st...@gmail.com on 30 Nov 2011 at 4:10

GoogleCodeExporter commented 9 years ago
For now I'm using a simple workaround.
My build config is below.
But here I didn't have to use includes which does not seem to work with this 
workaround.
{{
<build>
        <plugins>
            <plugin>
                <groupId>com.google.code.maven-replacer-plugin</groupId>
                <artifactId>maven-replacer-plugin</artifactId>
                <version>1.4.0</version>
                <executions>
                    <execution>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>replace</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <file>${basedir}/relative/path/to/file</file>
                    <basedir>
                        /
                    </basedir>                  <tokenValueMap>absolute/path/to/token/value/map</tokenValueMap>
                </configuration>
            </plugin>
        </plugins>
</build>
}}

Original comment by sujay.co...@gmail.com on 30 Nov 2011 at 6:03

GoogleCodeExporter commented 9 years ago
Code changes complete.
I have made tokenValueMap able to fall back to an absolute file in case it 
cannot be found by a relative path.

This means you can remove the basedir argument and simply insert an absolute 
path in your tokenValueMap.

However, I could not replicate a problem with includes not working for your 
workaround. Perhaps this fix will cover your problem with includes as well.

This has not been released yet but exists on the trunk. You can either wait for 
the next release which is going to happen soon (due to another outstanding 
issue making it a priority for me) or build off trunk and install this plugin 
into your local repository (as a snapshot). Check the InstallationGuide for 
more information with that.

I hope this resolves the issue for you and I am sorry this has taken me so long 
to get around to doing.

Steven

Original comment by baker.st...@gmail.com on 12 Mar 2012 at 5:59

GoogleCodeExporter commented 9 years ago
Thanks for the fix. I will wait for the release.

Original comment by sujay.co...@gmail.com on 12 Mar 2012 at 7:16

GoogleCodeExporter commented 9 years ago
Released as part of 1.5.0. This is being migrated through the central maven 
repo and will take a few hours.

Note: the artifactId was changed to "replacer" from "maven-replacer-plugin" 
(Issue 62) so you will need to change that too.

Original comment by baker.st...@gmail.com on 13 Mar 2012 at 12:13

GoogleCodeExporter commented 9 years ago
Just issue clean up.

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