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

2023-05-05 Thread via GitHub


gnodet commented on code in PR #1062:
URL: https://github.com/apache/maven/pull/1062#discussion_r1185871681


##
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:
   Not sure what you mean exactly.  The two properties `request.rootDirectory` 
and `request.topDirectory` are set just below.



-- 
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-unsubscr...@maven.apache.org

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



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

2023-05-05 Thread via GitHub


gnodet commented on code in PR #1062:
URL: https://github.com/apache/maven/pull/1062#discussion_r1185869307


##
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:
   I think the spotless _auto_ formatter that when there are more than 10 
classes imported from the same package.  This would have to be changed in maven 
parent's pom if we want to.



-- 
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-unsubscr...@maven.apache.org

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



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

2023-04-14 Thread via GitHub


gnodet commented on code in PR #1062:
URL: https://github.com/apache/maven/pull/1062#discussion_r1166721249


##
maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java:
##
@@ -544,6 +544,19 @@ public void populatePropertiesOverwrite() throws Exception 
{
 assertThat(request.getUserProperties().getProperty("x"), is("false"));
 }
 
+@Test
+public void testPropertiesInterpolation() throws Exception {

Review Comment:
   Added some tests.



-- 
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-unsubscr...@maven.apache.org

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