Uploaded image for project: 'Maven Site Plugin'
  1. Maven Site Plugin
  2. MSITE-933

mvn site fails when <name> contains &amp;

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 3.12.1, 4.0.0-M6
    • None
    • None
    • None
    • Ubuntu 22.04.2 LTS
      Apache Maven 3.9.0
      Java version: 17.0.4.1, vendor: Eclipse Adoptium

    Description

      A project containing an escaped ampersand in the name element fails in mvn site.

      Consider a project containing nothing but this pom.xml:

       

      <project>
          <modelVersion>4.0.0</modelVersion>
          <groupId>experiments</groupId>
          <artifactId>experiments</artifactId>
          <name>client for A&amp;B services</name>
          <version>0.0.1-SNAPSHOT</version>
      </project> 

      This project builds fine with the standard build cycle, e.g. mvn install.

      However, with mvn site (or explicitly mvn site:4.0.0-M6:site) it throws an error:

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:4.0.0-M6:site (default-cli) on project experiments: SiteToolException: Error parsing site descriptor: entity reference name can not contain character  ' (position: START_DOCUMENT seen ...//maven.apache.org/xsd/decoration-2.0.0.xsd" name="client for A&B ... @2:142) -> [Help 1]
      

      Escaping the ampersand twice helps, but it shouldn't be necessary:

          <name>client for A&amp;amp;B services</name>  

       

       

      Attachments

        Issue Links

          Activity

            People

              michael-o Michael Osipov
              drhok Heiko
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: