[ 
http://jira.codehaus.org/browse/MNG-3553?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=174057#action_174057
 ] 

John Casey commented on MNG-3553:
---------------------------------

If we import repository definitions along with dependencies through the scope 
== import feature, then this may throw off the snapshot resolution process for 
dependencies in the project that have nothing whatsoever to do with the 
imported dependencies.

This presents a dilemma: if we want to fix the problem above, we will most 
likely need to import custom repository definitions alongside dependencies; yet 
importing these repositories could change the way the rest of the dependencies 
resolve for that project. Also, changes in snapshot resolution coming from this 
sort of change would be pretty hard to track down, since there may be no trace 
in the POM listing the repository that supplies the latest snapshot version.

Since we cannot pin a particular dependency/artifact to a particular repository 
to make sure it's resolved there and there only, making this change will only 
make builds using scope == import harder to debug.

IMO, using the stated workaround (adding the custom repository to the POM that 
has the scope == import dependency) is probably the safest way to go, at least 
for Maven 2.x. Solving the problem in an automatic way results in the same 
basic approach...doing this manually only makes the step explicit and simpler 
to debug.

> cannot resolve dependency with scope import
> -------------------------------------------
>
>                 Key: MNG-3553
>                 URL: http://jira.codehaus.org/browse/MNG-3553
>             Project: Maven 2
>          Issue Type: Bug
>    Affects Versions: 2.0.9, 2.1.0
>            Reporter: Thomas Diesler
>            Priority: Critical
>             Fix For: 2.0.11, 2.1.1
>
>         Attachments: mng-3553.zip
>
>
> This pom when added as a dependency of another project does not see 
> repository http://snapshots.jboss.org/maven2
>   <!-- DependencyManagement -->
>   <dependencyManagement>
>     <dependencies>
>       <dependency>
>         <groupId>org.jboss.jbossas</groupId>
>         <artifactId>jboss-as-component-matrix</artifactId>
>         <version>${jboss.version}</version>
>         <type>pom</type>
>         <scope>import</scope>
>       </dependency>
>     </dependencies>
>   </dependencyManagement>
> with effective settings
> [tdies...@tddell trunk]$ mvn help:effective-settings
> [INFO] Scanning for projects...
> [INFO] Reactor build order: 
> [INFO]   JBoss Web Services - Stack CXF
> [INFO]   JBoss Web Services - Stack CXF Management
> [INFO]   JBoss Web Services - Stack CXF Runtime Server
> [INFO]   JBoss Web Services - Stack CXF Runtime Client
> [INFO] Searching repository for plugin with prefix: 'help'.
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Building JBoss Web Services - Stack CXF
> [INFO]    task-segment: [help:effective-settings] (aggregator-style)
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] [help:effective-settings]
> [INFO] 
> Effective settings:
> <?xml version="1.0"?><settings>
>   <localRepository>/home/tdiesler/.m2/repository</localRepository>
>   <profiles>
>     <profile>
>       <activation>
>         <property>
>           <name>!jboss.repository.off</name>
>         </property>
>       </activation>
>       <repositories>
>         <repository>
>           <snapshots />
>           <id>snapshots.jboss.org</id>
>           <url>http://snapshots.jboss.org/maven2</url>
>         </repository>
>         <repository>
>           <snapshots>
>             <enabled>false</enabled>
>           </snapshots>
>           <id>repository.jboss.org</id>
>           <url>http://repository.jboss.org/maven2</url>
>         </repository>
>       </repositories>
>       <id>jboss.repository</id>
>     </profile>
>   </profiles>
>   <activeProfiles>
>     <activeProfile>user-profile</activeProfile>
>   </activeProfiles>
>   <pluginGroups>
>     <pluginGroup>org.jboss.maven.plugins</pluginGroup>
>   </pluginGroups>
> </settings>

-- 
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