You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
effective-pom duplicate xml declaration and not pretty printed #421
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.
Activity