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-o (via GitHub)" <gi...@apache.org> on 2023/05/05 08:56:05 UTC

[GitHub] [maven] michael-o commented on a diff in pull request #1062: [MNG-6303] Interpolate user supplied properties and command line arguments

michael-o commented on code in PR #1062:
URL: https://github.com/apache/maven/pull/1062#discussion_r1185850625


##########
maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java:
##########
@@ -31,16 +31,8 @@
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;

Review Comment:
   Do we really want blanket import?



##########
maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java:
##########
@@ -552,6 +553,38 @@ public void findRootProjectWithAttribute() {
         assertEquals(test, new DefaultRootLocator().findRoot(test.resolve("child")));
     }
 
+    @Test
+    public void testPropertiesInterpolation() throws Exception {
+        // Arrange
+        CliRequest request = new CliRequest(
+                new String[] {
+                    "-Dfoo=bar",
+                    "-DvalFound=s${foo}i",
+                    "-DvalNotFound=s${foz}i",
+                    "-DvalRootDirectory=${session.rootDirectory}/.mvn/foo",
+                    "-DvalTopDirectory=${session.topDirectory}/pom.xml",
+                    "-f",
+                    "${session.rootDirectory}/my-child",
+                    "prefix:3.0.0:${foo}",
+                    "validate"

Review Comment:
   As far as I understand, they need to be defined ahead of time, right?



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org