You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (Jira)" <ji...@apache.org> on 2023/03/29 18:45:00 UTC

[jira] [Commented] (MSITE-933) mvn site fails when contains &

    [ https://issues.apache.org/jira/browse/MSITE-933?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17706556#comment-17706556 ] 

Michael Osipov commented on MSITE-933:
--------------------------------------

Well, yes I can confirm that the entire interpolation is not XML-safe because it is performed with strings.

> mvn site fails when <name> contains &amp;
> -----------------------------------------
>
>                 Key: MSITE-933
>                 URL: https://issues.apache.org/jira/browse/MSITE-933
>             Project: Maven Site Plugin
>          Issue Type: Bug
>    Affects Versions: 3.12.1, 4.0.0-M6
>         Environment: Ubuntu 22.04.2 LTS
> Apache Maven 3.9.0
> Java version: 17.0.4.1, vendor: Eclipse Adoptium
>            Reporter: Heiko
>            Priority: Major
>
> A project containing an escaped ampersand in the name element fails in mvn site.
> Consider a project containing nothing but this pom.xml:
>  
> {code:java}
> <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> {code}
> 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:
> {code:java}
> [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]
> {code}
> Escaping the ampersand twice helps, but it shouldn't be necessary:
> {code:java}
>     <name>client for A&amp;amp;B services</name>  {code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)