[ 
https://jira.codehaus.org/browse/MNG-4687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=307580#comment-307580
 ] 

Curtis Rueden commented on MNG-4687:
------------------------------------

I agree with Scott that automatic local resolution would be ideal. To respond 
to Laird's concern, without loss of generality, there are six cases for the 
behavior:

|| ||no relativePath given in child 
POM||<relativePath/>||<relativePath>..</relativePath>||
|*POM in parent dir _is_ the parent*|automatically use local POM in parent 
dir|force lookup in repo|force use of local POM in parent|
|*POM in parent dir is _not_ the parent (or there is no POM 
there)*|automatically do lookup in repo|force lookup in repo|force use of local 
POM in parent (will fail)|

So to avoid the case where the parent directory contains an out-of-date version 
of the parent POM, you could add "<relativePath/>" to your child POMs to always 
force a repository lookup. Personally I think this is a less common case than 
having a multi-module build and desiring it to use the local version of the POM 
in the parent directory when present.

This could be implemented easily by adding support for a special token (e.g., 
"AUTOMATIC") for the relativePath value, and changing the super POM's default 
value from ".." as it is now to "AUTOMATIC".
                
> Maven should not warn about incorrect parent path when no relativePath is 
> specified
> -----------------------------------------------------------------------------------
>
>                 Key: MNG-4687
>                 URL: https://jira.codehaus.org/browse/MNG-4687
>             Project: Maven 2 & 3
>          Issue Type: Improvement
>          Components: Logging
>    Affects Versions: 3.0-beta-1
>            Reporter: Paul Gier
>            Priority: Minor
>         Attachments: MNG-relativePath.zip
>
>
> If a module pom uses a parent other than the one in the parent directory, 
> maven logs a warning.  In some cases it is necessary that a module pom has an 
> external parent pom, and there is no way to refer to this external pom in the 
> relativePath.  If nothing is specified in the relativePath, Maven should not 
> log the warning.
> {noformat}
> [WARNING] 'parent.relativePath' of POM 
> org.maven.test:relative-path-parent:0.0.1-SNAPSHOT 
> (/home/pgier/projects/MNG-relativePath/module-1/pom.xml) points at 
> org.maven.test:relative-path-test instead of org.apache.maven:maven-parent, 
> please verify your project structure @ 
> {noformat}
> The attached zip reproduces the warning.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to