You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Herve Boutemy (Jira)" <ji...@apache.org> on 2021/03/27 17:37:00 UTC

[jira] [Comment Edited] (MNG-5781) resolution of nested import scoped dependencies causes maven to reach out to external central repo

    [ https://issues.apache.org/jira/browse/MNG-5781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17310027#comment-17310027 ] 

Herve Boutemy edited comment on MNG-5781 at 3/27/21, 5:36 PM:
--------------------------------------------------------------

looking at it, yes, it seems MNG-6772 is a duplicate of this issue

but this issue is more clear and has a good simple test: I'll probably use it more to dig


was (Author: hboutemy):
looking at it, yes, it seems MNG-6772 is a duplicate of this issue

but this issue is more clear and has a good test: I'll probably use it more to dig

> resolution of nested import scoped dependencies causes maven to reach out to external central repo
> --------------------------------------------------------------------------------------------------
>
>                 Key: MNG-5781
>                 URL: https://issues.apache.org/jira/browse/MNG-5781
>             Project: Maven
>          Issue Type: Bug
>          Components: Bootstrap &amp; Build, Dependencies
>    Affects Versions: 3.2.5
>         Environment: Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T09:29:23-08:00)
> Maven home: /usr/local/maven-3.2.5
> Java version: 1.7.0_76, vendor: Oracle Corporation
> Java home: /usr/local/jdk1.7.0_76-server-jre/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux", version: "2.6.32-504.3.3.el6.centos.plus.x86_64", arch: "amd64", family: "unix"
>            Reporter: Ravi Sanwal
>            Priority: Major
>             Fix For: 4.0.x-candidate
>
>         Attachments: MNG-5781-Maven360.txt, first.pom.xml, global_settings.xml, last.pom.xml, second.pom.xml
>
>
> When a project uses a dependency that has as import scoped dependency, which in turn also has another import scoped dependency (nested imported scoped dependencies), resolution of the last level of dependency makes maven to reach our to the external central repository ([https://repo.maven.apache.org/maven2/])
> Steps to reproduce:
> Use the attached global settings file.
> It has an internal repository declared as a replacement to 'central', you can point to one of your own internal repo.(not the local)
> Build the attached file first.pom.xml: 
> {code:java}
> mvn -gs global_settings.xml install -f first.pom.xml{code}
> Build the attached file second.pom.xml:
> {code:java}
> mvn install -f second.pom.xml{code}
> Then, delete _org.aspectj:aspectjtools from local repo (rm ~/.m2/repository/org/aspectj_/aspectjtools), we want to download this from our internal central repository alias repository.
> Build the attached file last.pom.xml: 
> {code:java}
> mvn -gs global_settings.xml dependency:copy-dependencies -f last.pom.xml{code}
> (copy dependencies because this is a pom project, alternatively change last.pom.xml to a jar project and do mvn -gs global_settings.xml install - same thing)
> You'll see that org.aspectj:aspectjtools is being downloaded from central ([https://repo.maven.apache.org/maven2/]) effectively rendering hosting our own repositories useless.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)