[ https://issues.apache.org/jira/browse/MNG-7038?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17622250#comment-17622250 ]
ASF GitHub Bot commented on MNG-7038: ------------------------------------- gnodet commented on PR #840: URL: https://github.com/apache/maven/pull/840#issuecomment-1286950230 > * check parent of current (non-effective) pom > * if it has relative path being non empty, check the given path > * check recursively until no more relative path is set/not found One question comes to my mind. Are all those properties system properties ? It would make sense to have some of them being computed relative to a given project (in the `pom.xml` or `MavenProject` sense). Especially if we want to support aggregating multiple projects in a single build, each _subproject_ should have a clearly to identify its own _topdir_. Given I don't think there's a simple way to find the logical root, especially when projects are used as subproject in a bigger build, we may need to actually use the fact that there is a `.mvn/` directory somewhere and stop there. Also children may have a parent outside the build itself, and thus we can not only going through the parents to find the _topdir_. I think that's how the current `maven.multiModuleDirectory` is computed, but we need one per-project, in case there's an aggregation. Also I would keep `project.xxx` for things that needs to be computed per-project (especially in case the project is used inside a bigger project), and `maven.` for things that are unmodified during the build. > 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)