Tuesday, 3 September 2013

XPath issue in Maven replacer plugin

XPath issue in Maven replacer plugin

I get the following error when trying to use XPath to replace in web.xml
with the Maven replacer plugin
[ERROR] Failed to execute goal
com.google.code.maven-replacer-plugin:replacer:1.5.2:replace (default) on
project my-project:
Error during XML replacement: Content is not allowed in prolog. -> [Help 1]
And here's the Maven code
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.2</version>
<executions>
<execution>
<phase>prepare-package</phase> <goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<file>src/main/webapp/WEB-INF/web.xml</file>
<outputFile>target/web.xml</outputFile>
<regexFlags>
<regexFlag>CASE_INSENSITIVE</regexFlag>
</regexFlags>
<replacements>
<replacement>
<xpath>/web-app/display-name</xpath>
<token>.*</token>
<value>${project.name}</value>
</replacement>
</replacements>
</plugin>
Any idea why?

No comments:

Post a Comment