mozzash / maven-replacer-plugin

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

Why is <token> required when using <xpath>? #100

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use this config:

           <replacements>
             <replacement>
               <xpath>/project/version/text()</xpath>
               <value>1337-FINAL</value>
             </replacement>      
           </replacements>

What is the expected output? What do you see instead?
I expect whatever value version had before to be replace by 1337-FINAL. Instead 
maven complains that <token> is missing or empty.

When I add a token, like "(*.)" or "*." it gives me:
Error during XML replacement: Content is not allowed in prolog

Just "*" even:
Error during XML replacement: Dangling meta character '*' near index 0

What version of the product are you using?
1.4.1

Original issue reported on code.google.com by notdiffi...@gmx.net on 15 Oct 2014 at 2:21

GoogleCodeExporter commented 9 years ago
Hi, the xpath is used to locate the text fragment you want to have the token 
searched upon and replaced.
If you want all of the text, try: .* (the pattern you have is back-to-front).

Original comment by baker.st...@gmail.com on 19 Oct 2014 at 9:23

GoogleCodeExporter commented 9 years ago
Thank you. That was it (together with using new version 1.5.3).

Maybe you could provide this example in the wiki section together with a 
complete pom.xml. I guess, that would help others too.

Solved.

Original comment by notdiffi...@gmx.net on 20 Oct 2014 at 7:32

GoogleCodeExporter commented 9 years ago

Original comment by baker.st...@gmail.com on 21 Oct 2014 at 3:40