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

Henri Tremblay commented on MNG-5146:
-------------------------------------

>From what I've seen (Maven 3.0.3) it seems that maven use a default parent 
>relative path set to "..". This is indeed invalid when the parent pom is not 
>the in parent directory. What is strange is that this default value doesn't 
>appear in the effective pom. So I can just guess that's what is happening.

The workaround seems to be to set the relative path to 
<relativePath></relativePath> (empty path). The error then disappear but I 
don't know if there's any side effect.

Maybe the simplest fix would be to mention the workaround in the error. "Can't 
find the parent pom using the default relative path which is the parent 
directory of the project. Please set it to the actual path of your parent pom 
or disable the warning by setting an empty relative path 
(<relativePath></relativePath>) if the pom is not available on your local 
directory." ... probably could be nicer than that but you get the idea.


> parent.relativePath Warning is very misleading
> ----------------------------------------------
>
>                 Key: MNG-5146
>                 URL: https://jira.codehaus.org/browse/MNG-5146
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Errors
>         Environment: Maven 3.0.3
>            Reporter: Scott MacDonald
>            Priority: Minor
>
> When a parent pom.xml is located in a sibling directory as the children, and 
> <relativePath> is not set in the <parent> element of the children, maven 
> spits out a completely bogus, very misleading, warning message.
> For example, suppose com.fubar  and com.parent are in sibling directories 
> (along with a bunch of other modules), and com.fubar specifies com.parent as 
> its parent, but does snot specify a parent.relativePath in it parent element. 
> When you run a build, you get the following...
> [INFO] Scanning for projects...
> [WARNING]
> [WARNING] Some problems were encountered while building the effective model 
> for com.fubar:jar:1234.5
> [WARNING] 'parent.relativePath' points at com.someRandomModule instead of 
> com.parent, please verify your project structure @ line
> 10, column 11
> [WARNING]
> [WARNING] It is highly recommended to fix these problems because they 
> threaten the stability of your build.
> [WARNING]
> [WARNING] For this reason, future Maven versions might no longer support 
> building such malformed projects.
> [WARNING]
> The warning incorrectly states that the child pom has specified 
> com.someRandomModule (a  completely unrelated module) as its parent when that 
> is completely not the case. The unlreated module, in this case, happens to be 
> an existing module in a differrnt  sibling directory, but otherwise has no 
> relation whatsoever to the parent or child.
> It would be much better to  warn about the actual problem....
> The actual problem is that maven first tries to resolve parent poms locally 
> based on the value of relativePath in the parent element of the child.  IF it 
> does not find it there, it will then resolve the parent from the repos.  The 
> current default value of relativepath is ../pom.xml  (which in my case 
> doesn;t work because my parent is in a sibling directory) 
> The warning should  be changed to something useful, such as....
> [WARNING]  Could not resolve parent pom locally using parent.relativePath 
> value of ../pom.xml.  Parent pom will be resolved from  local or remote 
> repository. To disable local parent pom resolution, specify 
> <relativePath><relativePath> in you <parent> element.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to