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

Ryan J commented on MNG-5086:
-----------------------------

Just in case anyone else runs into this, here is a modified version of the 
original attachment that does a better job of what I was trying to accomplish.  
I've been using this type of project layout as a 'workaround' for a few weeks, 
but I've found it actually works better than my original configuration.  
Benjamin's explanation makes it clear that my original configuration was 
broken.  The only changes are:

- remove modules from the parent POM
- include the parent POM and all modules in the group POM

I use multiple grouping modules for convenience so I have an easy way to build 
part of my project at a time.  For example, all of the client side modules vs 
all of the server side modules.

In the updated layout, the parent POM is used for dependency and plugin 
management.  The grouping logic is consolidated within dedicated modules that 
can be used optionally.  The grouping logic is easier to understand since it's 
clearer which modules are going to be built.  The parent module is easier to 
include as a build configuration on my build server since building every child 
module along with it is no longer a requirement.

Hopefully this is useful to anyone trying to solve a similar problem.  I 
apologize if it's poor etiquette for me to add to closed bug report.

> Maven 3.0.3 fails to use relativePath for parent pom location.
> --------------------------------------------------------------
>
>                 Key: MNG-5086
>                 URL: https://jira.codehaus.org/browse/MNG-5086
>             Project: Maven 2 & 3
>          Issue Type: Bug
>    Affects Versions: 3.0.3
>         Environment: Windows 7
>            Reporter: Ryan J
>            Assignee: Benjamin Bentmann
>         Attachments: maven-dependency-grouping-2.rar, 
> maven-dependency-grouping.zip
>
>
> After updating to Maven 3.0.3 I've noticed it fails to use the 'relativePath' 
> I've specified in the 'parent' section of my POMs.  The 
> [documentation|http://maven.apache.org/ref/3.0.3/maven-model/maven.html#class_parent]
>  states:
> {quote}
> Maven looks for the parent POM first in this location on the filesystem, then 
> the local repository, and lastly in the remote repo.
> {quote}
> However, this does not appear to be the case.  I'll attach an example project 
> (please excuse the inaccurate name).  To reproduce:
> 1) Go to the *group* module and run {{mvn clean install}}
> 2) Go to the *moduleA* module and run {{mvn compile}}
> Step one should install the modules *depends*, *moduleB* and *group* to the 
> local repository.  The *maven-dependency-grouping* module will _not_ be 
> installed to the local repository.  At step two, *moduleA* should compile, 
> but fails with the (partial) error:
> {quote}
> Could not find artifact 
> maven-dependency-grouping:maven-dependency-grouping:pom:0.1-SNAPSHOT in...
> {quote}
> According to the documentation, the above dependency should get resolved via 
> the 'relativePath' specified in the 'parent' element of the POM.  Maven 2.2.1 
> behaves correctly when repeating the above steps.

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

        

Reply via email to