You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sj...@apache.org on 2026/10/11 15:07:45 UTC
(maven) branch maven-4.0.x updated: Fix settings interpolation with double-hyphen paths
This is an automated email from the ASF dual-hosted git repository.
slawekjaranowski pushed a commit to branch maven-4.0.x
in repository https://gitbox.apache.org/repos/asf/maven.git
The following commit(s) were added to refs/heads/maven-4.0.x by this push:
new 67f9dbdc3b Fix settings interpolation with double-hyphen paths
67f9dbdc3b is described below
commit 67f9dbdc3b7d01c6a40c4b01c8a2d52245fe506e
Author: Efe Gökdemir <go...@gmail.com>
AuthorDate: Fri Oct 2 20:01:59 2026 +0300
Fix settings interpolation with double-hyphen paths
(cherry picked from commit 49d06ba3826834698a99210fd4d1103298dee5a4)
---
apache-maven/src/assembly/maven/conf/settings.xml | 8 ++++----
.../it/MavenITmng2577SettingsXmlInterpolationTest.java | 16 ++++++++++++++++
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/apache-maven/src/assembly/maven/conf/settings.xml b/apache-maven/src/assembly/maven/conf/settings.xml
index 8082c649c1..09f02ca80a 100644
--- a/apache-maven/src/assembly/maven/conf/settings.xml
+++ b/apache-maven/src/assembly/maven/conf/settings.xml
@@ -23,7 +23,7 @@ under the License.
| This is the configuration file for Maven. It can be specified at two levels:
|
| 1. User Level. This settings.xml file provides configuration for a single user,
- | and is normally provided in ${user.home}/.m2/settings.xml.
+ | and is normally provided in ~/.m2/settings.xml.
|
| NOTE: This location can be overridden with the CLI option:
|
@@ -33,7 +33,7 @@ under the License.
| This settings.xml file provides configuration for all Maven
| users on a machine (assuming they're all using the same Maven
| installation). It's normally provided in
- | ${maven.installation.conf}/settings.xml.
+ | /path/to/maven/conf/settings.xml.
|
| NOTE: This location can be overridden with the CLI option:
|
@@ -50,7 +50,7 @@ under the License.
<!-- localRepository
| The path to the local repository maven will use to store artifacts.
|
- | Default: ${user.home}/.m2/repository
+ | Default: ~/.m2/repository
<localRepository>/path/to/local/repo</localRepository>
-->
@@ -259,7 +259,7 @@ under the License.
| <artifactId>myplugin</artifactId>
|
| <configuration>
- | <tomcatLocation>${tomcatPath}</tomcatLocation>
+ | <tomcatLocation>/path/to/tomcat</tomcatLocation>
| </configuration>
| </plugin>
| ...
diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2577SettingsXmlInterpolationTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2577SettingsXmlInterpolationTest.java
index d9165732e0..879440b0d7 100644
--- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2577SettingsXmlInterpolationTest.java
+++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2577SettingsXmlInterpolationTest.java
@@ -86,4 +86,20 @@ public void testitSystemProps() throws Exception {
assertEquals("usr-prop-test", props.getProperty("settings.servers.0.username"));
assertEquals(File.separator, props.getProperty("settings.servers.0.password"));
}
+
+ /**
+ * Verify that the built-in settings.xml remains parseable when the user home contains a double-hyphen.
+ *
+ * @throws Exception in case of failure
+ */
+ @Test
+ public void testitUserHomeWithDoubleHyphen() throws Exception {
+ File testDir = extractResources("/mng-2577");
+
+ Verifier verifier = newVerifier(testDir.getAbsolutePath());
+ verifier.setUserHomeDirectory(testDir.toPath().resolve("foo--bar"));
+ verifier.addCliArgument("validate");
+ verifier.execute();
+ verifier.verifyErrorFreeLog();
+ }
}