Uploaded image for project: 'Maven Help Plugin'
  1. Maven Help Plugin
  2. MPH-206

help:effective-pom produces invalid xml (duplicate xml declarations) when bound to a phase in the lifecycle

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • 3.4.0
    • None
    • effective-pom
    • None

    Description

      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'):

       

      <?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"> 

      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):

      <?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"> 

       

       

      Configuration as part of lifecycle:

       

      <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> 

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            bendavini Ben Davini
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: