You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2023/05/05 08:57:00 UTC

[jira] [Commented] (MNG-6303) .mvn/jvm.config and .mvn/maven.config should allow to resolve environment variables

    [ https://issues.apache.org/jira/browse/MNG-6303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17719751#comment-17719751 ] 

ASF GitHub Bot commented on MNG-6303:
-------------------------------------

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?





> .mvn/jvm.config and .mvn/maven.config should allow to resolve environment variables
> -----------------------------------------------------------------------------------
>
>                 Key: MNG-6303
>                 URL: https://issues.apache.org/jira/browse/MNG-6303
>             Project: Maven
>          Issue Type: New Feature
>          Components: Bootstrap &amp; Build
>    Affects Versions: 3.5.0
>            Reporter: Konrad Windszus
>            Priority: Major
>
> With the mechanism of having project-specific maven options being specified in {{.mvn/maven.config}} and {{.mvn/jvm.config}} (MNG-6267) it is often handy to share those settings among multiple developers (i.e. via maintaining it via the SCM). Unfortunately the mechanism does not support resolving environment variables, which makes it hard to deal with user-specific directories or settings. Please support resolving environment variables through a special pattern like {{$ENV_NAME}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)