You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Stefan Bischof (Jira)" <ji...@apache.org> on 2023/01/04 12:33:00 UTC

[jira] [Comment Edited] (MNG-7038) Introduce public property to point to a root directory of (multi-module) project

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

Stefan Bischof edited comment on MNG-7038 at 1/4/23 12:32 PM:
--------------------------------------------------------------

Any Progress on this? Does *Fix Version/s:* [Issues to be reviewed for 4.x|https://issues.apache.org/jira/issues/?jql=project+%3D+MNG+AND+fixVersion+%3D+%22Issues+to+be+reviewed+for+4.x%22] mean that it will be in 4.0 Release?

Both properties seems to be adequate
*maven.multiModuleProjectDirectory* and *{{project.topdir}}*

After reading [https://maven.apache.org/guides/mini/guide-multiple-modules-4.html] and if you just wand to have it in reactor builds i would use
*project.reactor.dir* or *project.reactor.topdir*

But the discussion about the naming is not so important. its more important to have a proper description how it is calculated and in which cases it should be uses and in which it would fail.

And the description in the PR-840 seems clear.
"the directory containing the top level <<<pom.xml>>> file of a multi module project, in a single module project this is the same as <<<project.basedir>>>"


was (Author: bischofs@jena.de):
Any Progress on this? Does *Fix Version/s:*    [Issues to be reviewed for 4.x|https://issues.apache.org/jira/issues/?jql=project+%3D+MNG+AND+fixVersion+%3D+%22Issues+to+be+reviewed+for+4.x%22]  mean that it will be in 4.0 Release?

Both properties seems to be adequate
{*}maven.multiModuleProjectDirectory{*} and *{{project.topdir}}*

After reading [https://maven.apache.org/guides/mini/guide-multiple-modules-4.html] and if you just wand to have it in reactor builds i would use
*project.reactor.dir*

But the discussion about the naming is not so important. its more importat to have a proper description how it is calculated and in which cases it should be uses and in which it would fail.

 

> Introduce public property to point to a root directory of (multi-module) project
> --------------------------------------------------------------------------------
>
>                 Key: MNG-7038
>                 URL: https://issues.apache.org/jira/browse/MNG-7038
>             Project: Maven
>          Issue Type: Improvement
>            Reporter: Envious Guest
>            Priority: Major
>             Fix For: Issues to be reviewed for 4.x
>
>
> This is a request to expose a property *maven.multiModuleProjectDirectory* which is currently internal (or introduce a brand new one with analogous functionality).
>  * For a single-module project, its value should be same as *project.basedir*
>  * For multi-module project, its value should point to a project.basedir of a root module
> Example:
> multi-module // located at /home/me/sources
>  +- module-a
>  +- module B
> Sample multi-module/pom.xml: 
> {{<project>}}
>  {{    <parent>}}
>  {{        <groupId>com.acme</groupId>}}
>  {{        <artifactId>corp-parent</artifactId>}}
>  {{        <version>1.0.0-RELEASE</version>}}
>  {{    </parent>}}
>  {{    <groupId>com.acme</groupId>}}
>  {{        <artifactId>multi-module</artifactId>}}
>  {{        <version>0.5.2-SNAPSHOT</version>}}
>  {{    <modules>}}
>  {{        <module>module-a</module>}}
>  {{        <module>module-b</module>}}
>  {{    </modules>}}
>  {{</project>}}
> The property requested should return /home/me/sources/multi-module, regardless of whether it's referenced in any of the child modules (module-a, module-b) or in multi-module.
> Note that multi-module itself has parent (e.g. installed in a local repository), so the new property should be smart enough to detect it and still point to /home/me/sources/multi-module instead of the local repository where the corp-parent is installed.
> The use-case for such a property could be to have a directory for combined report of static analysis tools. Typical example - jacoco combined coverage reports.



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