[
https://issues.apache.org/jira/browse/MPH-206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17708923#comment-17708923
]
Ben Davini commented on MPH-206:
--------------------------------
I've attempted to repro this using the
[maven-help-plugin|https://github.com/apache/maven-help-plugin] repo directly
(instead of our internal 600+ module repo) and am not yet able to do that
there. I am working on generating a repro...
> help:effective-pom produces invalid xml (duplicate xml declarations) when
> bound to a phase in the lifecycle
> -----------------------------------------------------------------------------------------------------------
>
> Key: MPH-206
> URL: https://issues.apache.org/jira/browse/MPH-206
> Project: Maven Help Plugin
> Issue Type: Bug
> Components: effective-pom
> Affects Versions: 3.4.0
> Reporter: Ben Davini
> Priority: Critical
>
> When the maven-help-plugin is invoked as part of the maven lifecycle (see
> configuration below), it produces xml with 2 XML version declarations, like
> this (generated with 'mvn clean install'):
>
> {code:java}
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- ======================================================================
> --><!--
> --><!-- Generated by Maven Help Plugin
> --><!-- See: https://maven.apache.org/plugins/maven-help-plugin/
> --><!--
> --><!--
> ======================================================================
> --><!--
> ======================================================================
> --><!--
> --><!-- Effective POM for project
> --><!-- '<project coordinates>' --><!--
> --><!--
> ====================================================================== -->
> <?xml version="1.0" encoding="UTF-8"?>
> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> https://maven.apache.org/xsd/maven-4.0.0.xsd"
> xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> {code}
> When invoked via the command line (mvn help:effective-pom
> -Doutput=effective-pom.xml), the xml produced is valid (note no duplicate xml
> declaration before the 'project' declaration):
> {code:java}
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- ======================================================================
> --><!--
> --><!-- Generated by Maven Help Plugin
> --><!-- See: https://maven.apache.org/plugins/maven-help-plugin/
> --><!--
> --><!--
> ======================================================================
> --><!--
> ======================================================================
> --><!--
> --><!-- Effective POM for project
> --><!-- '<project coordinates>' --><!--
> --><!--
> ====================================================================== -->
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> https://maven.apache.org/xsd/maven-4.0.0.xsd"> {code}
>
>
> {{Configuration as part of lifecycle:}}
>
> {code:java}
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-help-plugin</artifactId>
> <version>${maven-help-plugin.version}</version>
> <executions>
> <execution>
> <id>effective-pom</id>
> <phase>verify</phase>
> <goals>
> <goal>effective-pom</goal>
> </goals>
> <configuration>
> <output>${project.build.directory}/effective-pom.xml</output>
> <verbose>true</verbose>
> </configuration>
> </execution>
> </executions>
> </plugin> {code}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)