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

Guillaume Nodet edited comment on MNG-7038 at 2/15/24 3:44 PM:
---------------------------------------------------------------

Fwiw, those properties are of type {{java.nio.file.Path}} which may not play 
well with maven 3 plugins or alike which only supports {{{}File{}}}.  A 
workaround is to use {{[the-prop].file}} instead.

 !image-2024-02-15-16-44-28-176.png! 


was (Author: gnt):
Fwiw, those properties are of type {{java.nio.file.Path}} which may not play 
well with maven 3 plugins or alike which only supports {{{}File{}}}.  A 
workaround is to use {{[the-prop].file}} instead.

{{[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------------------------------< org.apache.maven:maven 
>------------------------------------------------
[INFO] Building Apache Maven 4.0.0-alpha-13-SNAPSHOT
[INFO]   from pom.xml
[INFO] ---------------------------------------------------------[ pom 
]----------------------------------------------------------
[INFO] 
[INFO] --- help:3.4.0:evaluate (default-cli) @ maven ---
[INFO] No artifact parameter specified, using 
'org.apache.maven:maven:pom:4.0.0-alpha-13-SNAPSHOT' as project.
[INFO] 
/Users/gnodet/work/git/mvn4/maven
[INFO] Copying org.apache.maven:maven:pom:4.0.0-alpha-13-SNAPSHOT to project 
local repository
[INFO] Copying org.apache.maven:maven:pom:consumer:4.0.0-alpha-13-SNAPSHOT to 
project local repository
[INFO] 
--------------------------------------------------------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] 
--------------------------------------------------------------------------------------------------------------------------
[INFO] Total time:  0.477 s
[INFO] Finished at: 2024-02-15T16:42:01+01:00
[INFO] 
--------------------------------------------------------------------------------------------------------------------------
}}

> Introduce public properties to point to the root and top directories of 
> (multi-module) project
> ----------------------------------------------------------------------------------------------
>
>                 Key: MNG-7038
>                 URL: https://issues.apache.org/jira/browse/MNG-7038
>             Project: Maven
>          Issue Type: Improvement
>            Reporter: Envious Guest
>            Assignee: Guillaume Nodet
>            Priority: Major
>             Fix For: 4.0.0-alpha-7, 4.0.0
>
>         Attachments: image-2024-02-15-16-44-28-176.png
>
>
> This issue introduces three properties:
>  * {{project.rootDirectory}}: {_}the project's directory or parent directory 
> containing a {{.mvn}} subdirectory or a {{pom.xml}} flagged with the 
> {{root="true"}} attribute{_}. If no such directory can be found, accessing 
> the rootDirectory property will throw an `IllegalStateException`.
>  * {{session.topDirectory}} : {_}the directory of the topmost project being 
> built, usually the current directory or the directory pointed at by the 
> {{\-f}}/{{\-\-file}} command line argument{_}. The {{topDirectory}} is 
> similar to the {{executionRootDirectory}} property available on the session, 
> but renamed to make it coherent with the new {{rootDirectory}} and to avoid 
> using _root_ in its name. The {{topDirectory}} property is computed by the 
> CLI as the directory pointed at by the {{\-f}}/{{\-\-file}} command line 
> argument, or the current directory if there's no such argument.
>  * {{session.rootDirectory}} : {_}the rootDirectory for the topDirectory 
> project{_}.
> The {{topDirectory}} and {{rootDirectory}} properties are made available on 
> the {{MavenSession}} / {{Session}} and deprecate the 
> {{executionRootDirectory}} and {{multiModuleProjectDirectory}} properties. 
> The {{rootDirectory}} should never change for a given project and is thus 
> made available for profile activation and model interpolation (without the 
> {{project.}} prefix, similar to {{basedir}}). The goal is also to make the 
> {{rootDirectory}} property also available during [command line arguments 
> interpolation|https://issues.apache.org/jira/browse/MNG-6303].
> A {{root}} boolean attribute is also added to the model to indicate that the 
> project is the root project. This attribute is only supported if the 
> _buildconsumer_ feature is active and removed before the pom is installed or 
> deployed. It can be used as an alternative mechanism to the {{.mvn}} 
> directory.



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

Reply via email to