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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
