DhanaGitHub / maven-replacer-plugin

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

Can't replace with dynamic value form the properties file for the matched token #82

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<goals>prepare-package</goals>
<artifactId>replacer</artifactId>
<version>1.5.2</version>
<configuration>
<filesToInclude>target/test-classes/unittest.properties,
src/main/webapp/common/log4j-context.xml</filesToInclude>
<regex>true</regex>
<replacements>
<!-- The following replacement works, because it has spring.profiles.active= 
both in token and also in value -->
<replacement>
<token>spring.profiles.active=(.*)</token>
<value>spring.profiles.active=${springProfile}</value>
</replacement>
<!-- The following replacement does not work, want to retrieve just this
${host_app} value from *.properties file or based on the build server 
properties file -->
<replacement>
<token>&lt;property name=&quot;interceptor&quot; 
ref=&quot;sampleLogInterceptor&quot; /&gt;</token>
<value>${interceptorProperty}</value>
</replacement>                  </replacements>                             </configuration>
</plugin>

What is the expected output? What do you see instead?
- Would be good to see like other maven plugins has, if the value can be 
retrieved dynamically from the properties file. With this, based on the build 
server(QA, CI)this value can be replaced with what's there in those 
ci.properties or qa.properties file.

Sample ci.properties file:
interceptorProperty=&lt;property name=&quot;interceptors&quot; 
ref=&quot;advancedLogInterceptor&quot;/&gt;
What version of the product are you using?
1.5.2

Please provide any additional information below.

Original issue reported on code.google.com by ryanrak...@gmail.com on 21 Mar 2013 at 8:51

GoogleCodeExporter commented 9 years ago
Sorry...corrected the above configuration:

<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<goals>prepare-package</goals>
<artifactId>replacer</artifactId>
<version>1.5.2</version>
<configuration>
<filesToInclude>target/test-classes/unittest.properties,
src/main/webapp/common/log4j-context.xml</filesToInclude>
<regex>true</regex>
<replacements>
<!-- The following replacement works, because it has spring.profiles.active= 
both in token and also in value -->
<replacement>
<token>spring.profiles.active=(.*)</token>
<value>spring.profiles.active=${springProfile}</value>
</replacement>
<!-- The following replacement does not work, want to retrieve just this
${interceptorProperty value from *.properties file or based on the build server 
properties file -->
<replacement>
<token><property name="interceptor" ref="sampleLogInterceptor" /></token>
<value>${interceptorProperty}</value>
</replacement>                  </replacements>                             </configuration>
</plugin>

Original comment by ryanrak...@gmail.com on 21 Mar 2013 at 9:13

GoogleCodeExporter commented 9 years ago
Thanks for your last comment. I will close this issue.

Original comment by baker.st...@gmail.com on 23 Mar 2013 at 9:11