[ 
http://jira.codehaus.org/browse/MNG-4052?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benjamin Bentmann updated MNG-4052:
-----------------------------------

    Attachment: MNG-4052.zip

The problem is actually the build order of projects in the reactor. Maven 
currently does not recognize import-scope POMs as dependencies of the importing 
module. Hence the project sorter does not guarantee that the imported POM gets 
built before the importing module. And if the importing module is built before 
the imported POM, it can't resolve the imported POM from the reactor, hence the 
trip to the repos. The attached multi-module project demonstrates the problem 
when running "mvn validate" on the top-level project.

> import scope dependencies prefer to download pom rather than find it in the 
> current project
> -------------------------------------------------------------------------------------------
>
>                 Key: MNG-4052
>                 URL: http://jira.codehaus.org/browse/MNG-4052
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Reactor and workspace
>    Affects Versions: 2.0.9
>            Reporter: David Jencks
>         Attachments: MNG-4052.zip
>
>
> I've run into this in geronimo trunk.
> Initial project state:
> root pom includes dependency A in dependencyManagement.
> this dependency is used (in dependencies) in several places including 
> plugins/clustering/plugin-farm-datasource/
> Snapshots for this project are deployed (at apache snapshot repo)
> project update:
> move A to dependencyManagement of plugins/system-database/pom.xml (also a pom 
> packaging)
> include in plugins/clustering/plugin-farm-datasource/pom.xml
>     <dependencyManagement>
>         <dependencies>
>             <dependency>
>                 <groupId>org.apache.geronimo.plugins</groupId>
>                 <artifactId>system-database</artifactId>
>                 <version>${version}</version>
>                 <type>pom</type>
>                 <scope>import</scope>
>             </dependency>
>         </dependencies>
>     </dependencyManagement>
> (this is a car packaging project, using the geronimo car-maven-plugin)
> now, clean the local repo and try to build the project from root.
> we see:
> pb:trunk david$ mvn clean install -Pit
> [INFO] Scanning for projects...
> [INFO] snapshot org.apache.geronimo.plugins:system-database:2.2-SNAPSHOT: 
> checking for updates from apache.snapshots
> [INFO] snapshot org.apache.geronimo.plugins:system-database:2.2-SNAPSHOT: 
> checking for updates from apache-snapshots
> [INFO] snapshot org.apache.geronimo.plugins:system-database:2.2-SNAPSHOT: 
> checking for updates from codehaus-snapshots
> Downloading: 
> http://people.apache.org/repo/m2-snapshot-repository/org/apache/geronimo/plugins/system-database/2.2-SNAPSHOT/system-database-2.2-SNAPSHOT.pom
> rather than using the system-database pom in the local project it is 
> downloading the obsolete snapshot.
> I've worked around this by uploading the system-database pom by hand.
> I may try to write a sample project but since seeing the bug depends on 
> having a deployed snapshot and then changing it locally I have no idea how to 
> write an automated test.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to