[ https://issues.apache.org/jira/browse/MNG-7774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17718811#comment-17718811 ]
ASF GitHub Bot commented on MNG-7774: ------------------------------------- michael-o commented on code in PR #1098: URL: https://github.com/apache/maven/pull/1098#discussion_r1183323362 ########## maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java: ########## @@ -140,9 +146,14 @@ public class MavenCli { private static final String EXT_CLASS_PATH = "maven.ext.class.path"; - private static final String EXTENSIONS_FILENAME = ".mvn/extensions.xml"; + private static final String DOT_MVN = ".mvn"; - private static final String MVN_MAVEN_CONFIG = ".mvn/maven.config"; + private static final String UNABLE_TO_FIND_ROOT_PROJECT_MESSAGE = "Unable to find the root directory. Create a " + + DOT_MVN + " directory in the project root directory to identify it."; + + private static final String EXTENSIONS_FILENAME = DOT_MVN + "/extensions.xml"; + + private static final String MVN_MAVEN_CONFIG = DOT_MVN + "/maven.config"; Review Comment: Suffers from the same more or less. ########## maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java: ########## @@ -140,9 +146,14 @@ public class MavenCli { private static final String EXT_CLASS_PATH = "maven.ext.class.path"; - private static final String EXTENSIONS_FILENAME = ".mvn/extensions.xml"; + private static final String DOT_MVN = ".mvn"; - private static final String MVN_MAVEN_CONFIG = ".mvn/maven.config"; + private static final String UNABLE_TO_FIND_ROOT_PROJECT_MESSAGE = "Unable to find the root directory. Create a " + + DOT_MVN + " directory in the project root directory to identify it."; + + private static final String EXTENSIONS_FILENAME = DOT_MVN + "/extensions.xml"; Review Comment: That's not a filename anymore, but a path. ########## maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java: ########## @@ -526,8 +578,39 @@ private void commands(CliRequest cliRequest) { // Needed to make this method package visible to make writing a unit test possible // Maybe it's better to move some of those methods to separate class (SoC). - void properties(CliRequest cliRequest) { - populateProperties(cliRequest.commandLine, cliRequest.systemProperties, cliRequest.userProperties); + void properties(CliRequest cliRequest) throws ExitException { + try { + populateProperties(cliRequest, cliRequest.systemProperties, cliRequest.userProperties); + + StringSearchInterpolator interpolator = Review Comment: Any reason not to use the `StringRegexInterpolator`? > Maven config and command line interpolation > ------------------------------------------- > > Key: MNG-7774 > URL: https://issues.apache.org/jira/browse/MNG-7774 > Project: Maven > Issue Type: Task > Components: Command Line > Reporter: Tamas Cservenak > Assignee: Tamas Cservenak > Priority: Major > Fix For: 3.9.2 > > > Note: this issue "mildly follows" functionality done in Maven 4 as part of > MNG-7038 and MNG-6303, with partial implementation only (is not full > back-port), hence "mild introduction". > Rationale: many new resolver features are akin to be able to store their > configuration and input along SCM tracked Maven project sources. Sadly, > currently this is not possible. The two issues targeting Maven4 (MNG-7038 and > MNG-6303) with introduction of session and project "topDirectory" and > "rootDirectory" properties solve this. Still, Maven 3.9.x does not need all > of this. > So, idea is following: > * extend MavenCli to interpolate Maven arguments > * introduce two special properties {{session.rootDirectory}} and > {{session.topDirectory}} in interpolation. They are special, as they may not > be defined, and IF they are not defined, their use in Maven argument > interpolation causes error (Maven will not boot). > * limit the use of the two new properties to Maven CLI interpolation only. > This makes projects relying on Maven CLI interpolation "permeable" between > Maven 3.9.x and Maven 4, while all the whistle and bells (exposing this via > session or project) will be available in Maven 4 only. -- This message was sent by Atlassian Jira (v8.20.10#820010)