[ 
https://issues.apache.org/jira/browse/MNG-8162?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benjamin Marwell updated MNG-8162:
----------------------------------
    Description: 
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 subfolder 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 folders and the root tags are present?
* What if there are multitple .mvn folders (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 folder 
(<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 folder, 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).


  was:
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 subfolder 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 folders and the root tags are present?
* What if there are multitple .mvn folders (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 folder 
(<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 folder, 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.



> 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 subfolder 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 folders and the root tags are present?
> * What if there are multitple .mvn folders (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 folder 
> (<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 folder, 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)

Reply via email to