effective-pom duplicate xml declaration and not pretty printed
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- java
- Domain
- build-system
Research direction
Start with AbstractEffectiveMojo.prettyFormat() and EffectivePomMojo.execute(), then reproduce the issue using the attached pom.xml and mvn help:effective-pom -Dverbose=true. Compare the output with maven-help-plugin.txt; done means the effective POM has one XML declaration, is pretty-printed, and the verbose comments are formatted correctly.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Java
- Stars
- 29
- Forks
- 42
- Avg merge
- 23h 15m
- Merged PRs (30d)
- 6
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/maven-help-plugin
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 82/100
apache/maven-help-plugin#394 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/maven-help-plugin#389 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
apache/maven-help-plugin#388 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
apache/maven-help-plugin#386 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
apache/maven-help-plugin#385 ·
All issues in apache/maven-help-plugin
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
[BUG]茶杯方块在取茶时会引发崩溃 Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
1.0.0-alpha2 Type/Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
wso2/dpdp-accelerator#272 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
area/frontend
Difficulty 2/5 1-3 hours Newbie friendliness 65/100