Thanks for all the suggestions.  I tried them all but no luck.

\\\${service.root.url}/bullpen/readwrite does not stop variable replacement.
 ${dollar}{service.root.url} does not stop it either it actually resolves
the nested variables.
\u0024{service.root.url}/bullpen/readwrite does stop variable replacement
but then when you want to do the replacement it doesn't work.

It sure would be good if Maven used this
http://maven.apache.org/shared/maven-filtering/ approach everywhere.  Is
there a place I can make that request?

-Dave

On Thu, Jan 29, 2015 at 2:14 AM, Thomas Broyer <[email protected]> wrote:

> 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}.
>

Reply via email to