Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during XML replacement: Content is not allowed in prolog. #99

Open
GoogleCodeExporter opened this issue May 6, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Use attached pom.xml
2. Create folder src/ next to pom.xml, place empty test.java in there.
3. run "mvn compile"

What is the expected output? What do you see instead?
pom.xml should change its foo property.

Instead maven reports error:

     Failed to execute goal com.google.code.maven-replacer-plugin:maven-replacer-plugin:1.4.1:replace (default) on project testid: Error during XML replacement: Content is not allowed in prolog.

What version of the product are you using?
1.4.1

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 15 Oct 2014 at 2:13

Attachments:

@GoogleCodeExporter
Copy link
Author

Try the latest version.

There is a test case in the side project test-plugin-use that shows that xpath 
text replacement should be working and perhaps this was a bug.

Original comment by [email protected] on 19 Oct 2014 at 9:26

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

Thank you. I though I was using the latest version. I attached an updated 
pom.xml.

Now the problem is, that whatever is defined in the value tag gets written 
twice to the destination field. So I get:

  <properties>
    <foo>abcabc</foo>
  </properties>

Can you confirm?

Original comment by [email protected] on 20 Oct 2014 at 7:35

Attachments:

@GoogleCodeExporter
Copy link
Author

Try removing the "/text()" part from your xpath parameter. The plugin should 
locate the text component automatically.

Original comment by [email protected] on 21 Oct 2014 at 11:36

@GoogleCodeExporter
Copy link
Author

Nope.

<xpath>/project/properties/foo</xpath> still gives me:

[INFO] --- replacer:1.5.3:replace (default) @ testid ---
[Fatal Error] :1:1: Content is not allowed in prolog.
[ERROR] Error during XML replacement: Content is not allowed in prolog.
[INFO] Replacement run on 0 file.

Original comment by [email protected] on 22 Oct 2014 at 5:57

@GoogleCodeExporter
Copy link
Author

I see the same thing happen when using 1.5.3 of this plugin while not even 
using regex. It looks like the replace does not continue after the 
replacement-value.

Original comment by [email protected] on 20 Feb 2015 at 12:44

@GoogleCodeExporter
Copy link
Author

And this only goes wrong when the first part of the string stays the same. So: 
when the token is 'abc' and the replacement is 'abc-extra' we get 
'abcabc-extra' and when we have token 'abc' and the replacement is 'xyz-extra' 
we get 'xyz-extra'.

Original comment by [email protected] on 20 Feb 2015 at 1:00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant