tbroyer opened a new issue, #13321:
URL: https://github.com/apache/maven/issues/13321

   ### Affected version
   
   3.10.0
   
   ### Bug description
   
   The built-in `settings.xml` contains `${…}` placeholders inside XML 
comments. Interpolating them can lead to malformed XML if, e.g., the value 
contains a double-hyphen.
   
   This happens to us in our CI where most workspaces contain double-hyphens in 
their paths (e.g. `/var/lib/jenkins/workspaces/someproject--release/`), because 
we set this path as the `-Duser.home=` (and `$HOME`) of the Maven process we're 
running (this is done automatically through environment variables: 
`HOME="$WORKSPACE" JAVA_TOOL_OPTIONS="-Duser.home=$WORKSPACE"`).
   
   This can easily be reproduced with the standard Docker image:
   ```sh
   $ docker run --rm maven:3 mvn -Duser.home=/foo--bar/
   [ERROR] Error executing Maven.
   [ERROR] 1 problem was encountered while building the effective settings
   [FATAL] Non-parseable settings /usr/share/maven/conf/settings.xml: in 
comment after two dashes (--) next character must be > not b (position: 
START_DOCUMENT seen ...ingle user,\n |                 and is normally provided 
in /foo--b... @26:55)  @ /usr/share/maven/conf/settings.xml, line 26, column 55
   
   $ docker run --rm -e JAVA_TOOL_OPTIONS=-Duser.home=/foo--bar/ maven:3 mvn 
   Picked up JAVA_TOOL_OPTIONS: -Duser.home=/foo--bar/
   [ERROR] Error executing Maven.
   [ERROR] 1 problem was encountered while building the effective settings
   [FATAL] Non-parseable settings /usr/share/maven/conf/settings.xml: in 
comment after two dashes (--) next character must be > not b (position: 
START_DOCUMENT seen ...ingle user,\n |                 and is normally provided 
in /foo--b... @26:55)  @ /usr/share/maven/conf/settings.xml, line 26, column 55
   
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to