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

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

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


##########
maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java:
##########
@@ -494,14 +504,51 @@ public interface MavenExecutionRequest {
 
     /**
      * @since 3.3.0
+     * @deprecated use {@link #setRootdir(Path)} instead
      */
+    @Deprecated
     void setMultiModuleProjectDirectory(File file);
 
     /**
      * @since 3.3.0
+     * @deprecated use {@link #getRootdir()} instead
      */
+    @Deprecated
     File getMultiModuleProjectDirectory();
 
+    /**
+     * Sets the top dir of the project.
+     *
+     * @since 4.0.0
+     */
+    MavenExecutionRequest setTopdir(Path topdir);

Review Comment:
   dir --> Directory, here and elsewhere
   
   That is, don't abbreviate. 



##########
maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java:
##########
@@ -494,14 +504,51 @@ public interface MavenExecutionRequest {
 
     /**
      * @since 3.3.0
+     * @deprecated use {@link #setRootdir(Path)} instead
      */
+    @Deprecated
     void setMultiModuleProjectDirectory(File file);
 
     /**
      * @since 3.3.0
+     * @deprecated use {@link #getRootdir()} instead
      */
+    @Deprecated
     File getMultiModuleProjectDirectory();
 
+    /**
+     * Sets the top dir of the project.
+     *
+     * @since 4.0.0
+     */
+    MavenExecutionRequest setTopdir(Path topdir);
+
+    /**
+     * Gets the directory of the topmost project being built, usually the 
current directory or the
+     * directory pointed at by the {@code -f/--file} command line argument.

Review Comment:
   pointed at by --> specified by 



##########
maven-core/src/main/java/org/apache/maven/execution/MavenSession.java:
##########
@@ -141,10 +142,30 @@ public List<MavenProject> getProjects() {
         return projects;
     }
 
+    /**
+     * @deprecated use {@link #getTopdir()}
+     */
+    @Deprecated
     public String getExecutionRootDirectory() {
         return request.getBaseDirectory();
     }
 
+    /**
+     * @see MavenExecutionRequest#getTopdir()
+     * @since 4.0.0
+     */
+    public Path getTopdir() {
+        return request.getTopdir();
+    }
+
+    /**
+     * @see MavenExecutionRequest#getRootdir()
+     * @since 4.0.0
+     */

Review Comment:
   RootDirectory



##########
api/maven-api-core/src/main/java/org/apache/maven/api/Project.java:
##########
@@ -86,8 +86,42 @@ default String getId() {
         return getModel().getId();
     }
 
+    /**
+     * @deprecated use {@link #isTopProject()} instead
+     */
+    @Deprecated
     boolean isExecutionRoot();
 
+    /**
+     * Returns a boolean indicating if the project is the top level project for
+     * this reactor build.  The top level project may be different from the
+     * {@code rootDirProject}, especially if a subtree of the project is being
+     * built, either because Maven has been launched in a subdirectory or using
+     * a {@code -f} option.
+     *
+     * @return {@code true} if the project is the top level project for this 
build
+     */
+    boolean isTopProject();
+
+    /**
+     * Returns a boolean indicating if the project is a root project,
+     * meaning that .

Review Comment:
   incomplete



##########
src/mdo/writer-ex.vm:
##########
@@ -210,8 +210,15 @@ public class ${className}
       #set ( $fieldCapName = $Helper.capitalise( $field.name ) )
       #if ( $field.type == "String" )
             writeAttr( "$fieldTagName", ${classLcapName}.get${fieldCapName}(), 
serializer );
+      #elseif ( $field.type == "boolean" )
+        #set ( $def = ${field.defaultValue} )
+        #if ( ${def} == "true" )
+            writeAttr( "$fieldTagName", ${classLcapName}.is${fieldCapName}() ? 
null : "false", serializer );
+        #else
+            writeAttr( "$fieldTagName", ${classLcapName}.is${fieldCapName}() ? 
"true" : null, serializer );
+        #end
       #else
-        // TODO: type=${field.type} to=${field.to} 
multiplicity=${field.multiplicity}
+            // TODO: type=${field.type} to=${field.to} 
multiplicity=${field.multiplicity}

Review Comment:
   is this TODO still relevant? Can it be removed?



##########
src/mdo/writer.vm:
##########
@@ -192,8 +192,15 @@ public class ${className}
       #set ( $fieldCapName = $Helper.capitalise( $field.name ) )
       #if ( $field.type == "String" )
             writeAttr( "$fieldTagName", ${classLcapName}.get${fieldCapName}(), 
serializer );
+      #elseif ( $field.type == "boolean" )
+        #set ( $def = ${field.defaultValue} )
+        #if ( ${def} == "true" )
+            writeAttr( "$fieldTagName", ${classLcapName}.is${fieldCapName}() ? 
null : "false", serializer );
+        #else
+            writeAttr( "$fieldTagName", ${classLcapName}.is${fieldCapName}() ? 
"true" : null, serializer );
+        #end
       #else
-        // TODO: type=${field.type} to=${field.to} 
multiplicity=${field.multiplicity}
+            // TODO: type=${field.type} to=${field.to} 
multiplicity=${field.multiplicity}

Review Comment:
   is this TODO still relevant? Can it be removed?



##########
maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java:
##########
@@ -91,8 +92,17 @@ public interface MavenExecutionRequest {
     // ----------------------------------------------------------------------
 
     // Base directory
+
+    /**
+     * @deprecated use {@link #setTopdir(Path)} instead

Review Comment:
   Are the base directory and the top directory different? if so, how? (Please 
don't answer in github comments. Instead add this info to the code.) If not, 
why this change?





> .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)

Reply via email to