You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Arnaud Heritier (JIRA)" <ji...@codehaus.org> on 2009/04/30 15:24:46 UTC

[jira] Issue Comment Edited: (MNG-3553) cannot resolve dependency with scope import

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

Arnaud Heritier edited comment on MNG-3553 at 4/30/09 8:24 AM:
---------------------------------------------------------------

You'll find attached the testcase to reproduce my issue.
I installed locally a nexus server (1.3.3 Open Source) and I'm using maven 2.1.0 (I reproduced the issue with 2.0.10).
In the releases repository of nexus you upload all artifacts given in the {{toUpload}} directory :
* parent 1.0.0 pom
* dependencies 1.0.0 pom
* module 1.0.0 pom and jar

You'll find in the root of the archive my settings. It defines to use nexus for the central repository.
You launch a build of the project and you'll have :
{code}
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - org.apache.maven.it.mng3553:project:jar:1.0.0-SNAPSHOT
[INFO]    task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory E:\jtb\workspaces\tests\test-mng3553\project\src\main\resources
Downloading: http://localhost:8081/nexus/content/groups/public//org/apache/maven/it/mng3553/module/1.0.0/module-1.0.0.pom
867b downloaded  (module-1.0.0.pom)
Downloading: http://repo1.maven.org/maven2/org/apache/maven/it/mng3553/dependencies/1.0.0/dependencies-1.0.0.pom
[WARNING] Unable to get resource 'org.apache.maven.it.mng3553:dependencies:pom:1.0.0' from repository central (http://repo1.maven.org/maven2): Authorization fai
led: Access denied to: http://repo1.maven.org/maven2/org/apache/maven/it/mng3553/dependencies/1.0.0/dependencies-1.0.0.pom
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
GroupId: org.apache.maven.it.mng3553
ArtifactId: dependencies
Version: 1.0.0
Reason: Unable to download the artifact from any repository
  org.apache.maven.it.mng3553:dependencies:pom:1.0.0
from the specified remote repositories:
  central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Thu Apr 30 15:19:47 CEST 2009
[INFO] Final Memory: 6M/254M
[INFO] ------------------------------------------------------------------------
{code}
You can see that the project downloads successfully the module-1.0.0 from nexus but it fails for depencencies which is an import. It tries to download it from the real central repository and not from the one I defined in my settings. 
The behavior is inconsistent...

      was (Author: aheritier):
    You'll find attached the testcase to reproduce my issue.
I installed locally a nexus server (1.3.3 Open Source) and I'm using maven 2.1.0 (I reproduced the issue with 2.0.10).
In the releases repository of nexus you upload all artifacts given in the {{toUpload}} directory :
* parent 1.0.0 pom
* dependencies 1.0.0 pom
* module 1.0.0 pom and jar
You'll find in the root of the archive my settings. It defines to use nexus for the central repository.
You launch a build of the project and you'll have :
{code}
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - org.apache.maven.it.mng3553:project:jar:1.0.0-SNAPSHOT
[INFO]    task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory E:\jtb\workspaces\tests\test-mng3553\project\src\main\resources
Downloading: http://localhost:8081/nexus/content/groups/public//org/apache/maven/it/mng3553/module/1.0.0/module-1.0.0.pom
867b downloaded  (module-1.0.0.pom)
Downloading: http://repo1.maven.org/maven2/org/apache/maven/it/mng3553/dependencies/1.0.0/dependencies-1.0.0.pom
[WARNING] Unable to get resource 'org.apache.maven.it.mng3553:dependencies:pom:1.0.0' from repository central (http://repo1.maven.org/maven2): Authorization fai
led: Access denied to: http://repo1.maven.org/maven2/org/apache/maven/it/mng3553/dependencies/1.0.0/dependencies-1.0.0.pom
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
GroupId: org.apache.maven.it.mng3553
ArtifactId: dependencies
Version: 1.0.0
Reason: Unable to download the artifact from any repository
  org.apache.maven.it.mng3553:dependencies:pom:1.0.0
from the specified remote repositories:
  central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Thu Apr 30 15:19:47 CEST 2009
[INFO] Final Memory: 6M/254M
[INFO] ------------------------------------------------------------------------
{code}
You can see that the project downloads successfully the module-1.0.0 from nexus but it fails for depencencies which is an import. It tries to download it from the real central repository and not from the one I defined in my settings. 
The behavior is inconsistent...
  
> 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.2.0
>
>         Attachments: mng-3553.zip, test-mng3553.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
> [tdiesler@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