Details
Description
When no site descriptor file exists in the project,
executing the effective-site goal and the site goal in order like below fails.
>mvn -Doutput=src/site/site.xml site:effective-site
>mvn site:site
Error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.2:site (default-cli) on project maven-exercise: SiteToolException: Error parsing site descriptor: processing instruction can not have PITarget with reserveld xml name (position: START_DOCUMENT seen ...==================================================== -->\r\n\r\n<?xml ... @16:7) -> [Help 1]
The contents of site.xml generated by effective-site goal:
<?xml version="1.0" encoding="UTF-8"?> <!-- ====================================================================== --> <!-- --> <!-- Generated by Maven Site Plugin on 2012-12-12T12:46:21 --> <!-- See: http://maven.apache.org/plugins/maven-site-plugin/ --> <!-- --> <!-- ====================================================================== --> <!-- ====================================================================== --> <!-- --> <!-- Effective site descriptor for project --> <!-- 'com.newmainsoftech:maven-exercise:jar:1.0-SNAPSHOT' --> <!-- --> <!-- ====================================================================== --> <?xml version="1.0" encoding="UTF-8"?> <project xsi:schemaLocation="http://maven.apache.org/DECORATION/1.3.0 http://maven.apache.org/xsd/decoration-1.3.0.xsd" name="maven-exercise" xmlns="http://maven.apache.org/DECORATION/1.3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <bannerLeft> <name>maven-exercise</name> </bannerLeft> <body> <links> <item name="maven-exercise" href="./" /> </links> <menu ref="parent" /> <menu ref="reports" /> </body> </project>
When no site descriptor file exists, could you make the generated contents by the effective-site goal with the output parameter valid as a site descriptor file, so that the site goal works without removing duplicate XML declaration and the comments manually from it first?