[
https://issues.apache.org/jira/browse/MNG-8162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17856539#comment-17856539
]
Matthias Bünger commented on MNG-8162:
--------------------------------------
As already written in Slack I support this idea as a step (Maven 4) into the
direction to enforce (Maven 5) a structure following the maven default
project/module convetion. With the more detailed possibilites to define the
project's root (see #MNG-7038) I'm convinced this will reduce difficult /
problematic situations resulting in an overall easier / more comprehensible
usage of Maven, esp. with plugins which allow file-based/file-related
configuration (e.g. PMD-Plugin).
{quote}
[WARN] This maven project has modules relative to the parent directory
(<module>../{..}</module>. This is an invalid configuration and will be
unsupported in future releases. To fix, move all descendants of a pom project
to its directory, making it a direct descendant.
{quote}
The beginning of the last sentence sounds a bit clumsy to me - would suggest to
change it to
{quote}
To fix this issue, move all descendants of a pom project to its directory,
making it a direct descendant.
{quote}
Maybe we can also add a link to an example... which aehm does not exists?
Thought it would be in the [User
Centre|https://maven.apache.org/users/index.html], but is not. Neither on
[standard directory
layout|https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html]
nor [Guide to working with multiple module
projects|https://maven.apache.org/guides/mini/guide-multiple-modules-4.html]
the default hierarchie is shown :O
> Maven should warn about modules relative to parent directory
> ------------------------------------------------------------
>
> Key: MNG-8162
> URL: https://issues.apache.org/jira/browse/MNG-8162
> Project: Maven
> Issue Type: Task
> Components: Core
> Reporter: Benjamin Marwell
> Priority: Major
>
> Maven should warn if a pom project references modules which are not direct
> descendants, e.g.
> {code:html}
> <module>../other</module>
> {code}
> h2. Rationale
> Given this situation:
> * the repository root does not contain the root pom.xml
> * A subdirectory contains the "root" pom.xml (e.g. ./Build/pom.xml)
> * Maven must be called either via {{mvn -f Build}} or {{cd Build && mvn}}
> Then it is hard to determine the root:
> * Is it in the VCS clone/checkout root?
> * Is it in the first common ancestor? Maybe it is in
> {{project/dev/impl/Build}} ?
> * Is root=true a valid tag in either of these cases?
> * what if you call maven from even yet a higher directory?
> * What if both .mvn directores and the root tags are present?
> * What if there are multitple .mvn directories (lets say in repo root, and in
> ./project/dev/impl and in ./project/dev/impl/Build)?
> In any of those cases and combinations of those, Maven should print a warning
> h2. Suggested warning
> {code}
> [WARN] This maven project has modules relative to the parent directory
> (<module>../{..}</module>. This is an invalid configuration and will be
> unsupported in future releases. To fix, move all descendants of a pom project
> to its directory, making it a direct descendant.
> {code}
> h2. Checks
> Should be included in the new self-check
> h2. Suggested deprecation
> Maven 5 should not work under such circumstances
> h2. Backports
> Might be a candidate for backporting to 3.9.
> h2. Documentation
> The docs should clarify which "root" takes precedence (and why).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)