You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "maroschutte (via GitHub)" <gi...@apache.org> on 2026/08/13 11:39:45 UTC
[I] effective-pom duplicate xml declaration and not pretty printed [maven-help-plugin]
maroschutte opened a new issue, #421:
URL: https://github.com/apache/maven-help-plugin/issues/421
### Affected version
3.5.2
### Bug description
The effective-pom goal will generate invalid XML output in some cases. Run 'mvn help:effective-pom -Dverbose=true' on the attached pom.xml and you will see output like that in maven-help-plugin.txt
This output shows the following problems:
* There are two xml declarations, this is actually invalid
* The xml has not been pretty-printed
* Comments from the 'verbose' flag still start with <!--}
Of course this is triggered by the property <org.mockito:mockito-core:jar>. In a namespaced xml document this is illegal, but maven accepts it. I also didn't make this syntax up, it is what the dependency:properties goal generates.
I have traced these issues to the AbstractEffectiveMojo.prettyFormat() method. A JDOMexception is thrown, causing it to return the unmodified version of the pom. This explains the second xml declaration, whereas the first is written by the writeHeader() method.
Because the pretty printing isn't actually done, the regexp replacement of the <!--} syntax in EffectivePomMojo.execute() also fails as there is no whitespace between the tag and the comment.
[maven-help-plugin.txt](https://github.com/user-attachments/files/31027001/maven-help-plugin.txt)
[pom.xml](https://github.com/user-attachments/files/31026667/pom.xml)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] effective-pom duplicate xml declaration and not pretty printed [maven-help-plugin]
Posted by "slachiewicz (via GitHub)" <gi...@apache.org>.
slachiewicz closed issue #421: effective-pom duplicate xml declaration and not pretty printed
URL: https://github.com/apache/maven-help-plugin/issues/421
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org