diff --git a/impl/maven-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultInterpolator.java b/impl/maven-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultInterpolator.java index 191b7f11f4..f73d876c90 100644 --- a/impl/maven-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultInterpolator.java +++ b/impl/maven-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultInterpolator.java @@ -420,7 +420,7 @@ public class DefaultInterpolator implements Interpolator { int escape = val.indexOf(ESCAPE_CHAR); while (escape >= 0 && escape < val.length() - 1) { char c = val.charAt(escape + 1); - if (c == '{' || c == '}' || c == ESCAPE_CHAR) { + if (c == '{' || c == '}') { val = val.substring(0, escape) + val.substring(escape + 1); } escape = val.indexOf(ESCAPE_CHAR, escape + 1); diff --git a/impl/maven-impl/src/test/java/org/apache/maven/internal/impl/model/DefaultInterpolatorTest.java b/impl/maven-impl/src/test/java/org/apache/maven/internal/impl/model/DefaultInterpolatorTest.java index ee77b5dc60..9a0c9c70a6 100644 --- a/impl/maven-impl/src/test/java/org/apache/maven/internal/impl/model/DefaultInterpolatorTest.java +++ b/impl/maven-impl/src/test/java/org/apache/maven/internal/impl/model/DefaultInterpolatorTest.java @@ -98,6 +98,7 @@ class DefaultInterpolatorTest { assertEquals("${a}", substVars("$\\{a${#}\\}", "b")); assertEquals("${a}", substVars("$\\{a\\}${#}", "b")); assertEquals("${a}", substVars("$\\{a\\}", "b")); + assertEquals("\\\\", substVars("\\\\", "b")); } @Test