On Wed Jan 28 2015 at 20:18:53 David Hoffer <[email protected]> wrote:
> I have a case where I have a text file that is generated with a hard coded > string and I would like to replace that with Maven variables, but I want > the literal variable string to go in the file not the interpolated values. > > I read http://maven.apache.org/shared/maven-filtering/ that i should be > able to do this with a leading \ but that doesn't work. It still > resolves ${service.root.url}. > > <execution> > <id>replace-namespace</id> > <phase>generate-resources</phase> > <goals> > <goal>run</goal> > </goals> > <configuration> > <failOnError>true</failOnError> > <target> > <replace > dir="${project.build.directory}/generated-resources/META-INF/" token=" > http://jmsappsvr/bullpen/service" > value="\${service.root.url}/bullpen/readwrite" > > That property is substituted during evaluation of the POM, not by the maven-filtering (which, to my knowledge, is not used in this case). According to https://stackoverflow.com/q/7751696/116472, $${service.root.url} might work (or not). Using a unicode escape for the '$' sign worked for some people: value="\u0024{service.root.url}/bullpen/readwrite"; and despite the comments in this QA, I'd try defining a <dollar>$</dollar> property and then using ${dollar}{service.root.url}.
