[ https://issues.apache.org/jira/browse/MNG-6879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17066180#comment-17066180 ]
Robert Scholte commented on MNG-6879: ------------------------------------- If you want to reroute central, you should use a mirror, see https://maven.apache.org/guides/mini/guide-mirror-settings.html Let me know if this solves the problem. > When the repo with the id of central is configured in settings.xml and the > scope = import dependency is included in the project of the project, the > central repo has a problem > ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ > > Key: MNG-6879 > URL: https://issues.apache.org/jira/browse/MNG-6879 > Project: Maven > Issue Type: Bug > Components: Artifacts and Repositories > Affects Versions: 3.6.2 > Environment: Mac,maven 3.6.2 > Reporter: wuzishu > Priority: Major > Attachments: image-2020-03-24-21-39-54-127.png, > image-2020-03-24-21-47-50-561.png, image-2020-03-24-21-49-31-997.png, > image-2020-03-24-21-57-58-635.png, image-2020-03-24-21-58-35-400.png, > image-2020-03-24-22-00-08-867.png, image-2020-03-24-22-01-04-185.png > > > When the repo with the id of central is configured in settings.xml and the > scope = import dependency is included in the project of the project, the > central repo has a problem > > *settings.xml配置如下*: > {code:java} > <profile> > <id>nexusRep</id> > <repositories> > <repository> > <id>nexus</id> > <name>Nexus Repository</name> > <url>https://repo.spring.io/libs-release1</url> > <releases><enabled>true</enabled></releases> > <snapshots><enabled>true</enabled></snapshots> > </repository> > </repositories> > <pluginRepositories> > <pluginRepository> > <id>nexus</id> > <name>Nexus pluginRepository</name> > <url>https://repo.spring.io/libs-release1</url> > <releases><enabled>true</enabled></releases> > <snapshots><enabled>true</enabled></snapshots> > </pluginRepository> > </pluginRepositories> > </profile> > <profile> > <id>central</id> > <repositories> > <repository> > <id>central</id> > <name>Nexus Repository</name> > <url>https://repo.spring.io/libs-release</url> > <releases><enabled>true</enabled></releases> > <snapshots><enabled>true</enabled></snapshots> > </repository> > </repositories> > <pluginRepositories> > <pluginRepository> > <id>central</id> > <name>Nexus pluginRepository</name> > <url>https://repo.spring.io/libs-release</url> > <releases><enabled>true</enabled></releases> > <snapshots><enabled>true</enabled></snapshots> > </pluginRepository> > </pluginRepositories> > </profile> > > </profiles> > <!-- activeProfiles > | List of profiles that are active for all builds. > | > <activeProfiles> > <activeProfile>alwaysActiveProfile</activeProfile> > <activeProfile>anotherAlwaysActiveProfile</activeProfile> > </activeProfiles> > --> > <activeProfiles> > <activeProfile>nexusRep</activeProfile> > <activeProfile>central</activeProfile> > </activeProfiles> > {code} > > *project pom.xml:* > {code:java} > //代码占位符 > <?xml version="1.0" encoding="UTF-8"?> > <project xmlns="http://maven.apache.org/POM/4.0.0" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 > https://maven.apache.org/xsd/maven-4.0.0.xsd"> > <modelVersion>4.0.0</modelVersion> > <parent> > <groupId>org.springframework.boot</groupId> > <artifactId>spring-boot-starter-parent</artifactId> > <version>2.2.5.RELEASE</version> > <relativePath/> <!-- lookup parent from repository --> > </parent> > <groupId>com.example</groupId> > <artifactId>demo</artifactId> > <version>0.0.1-SNAPSHOT</version> > <name>demo</name> > <description>Demo project for Spring Boot</description> > <properties> > <java.version>1.8</java.version> > > <spring-cloud-dependencies.version>Angel.SR6</spring-cloud-dependencies.version> > </properties> > <dependencies> > <dependency> > <groupId>org.springframework.boot</groupId> > <artifactId>spring-boot-starter-web</artifactId> > </dependency> > <dependency> > <groupId>org.springframework.cloud</groupId> > <artifactId>spring-cloud-dependencies</artifactId> > <version>${spring-cloud-dependencies.version}</version> > <type>pom</type> > <scope>import</scope> > </dependency> > <dependency> > <groupId>org.projectlombok</groupId> > <artifactId>lombok</artifactId> > <scope>compile</scope> > <optional>true</optional> > </dependency> > <dependency> > <groupId>org.springframework.boot</groupId> > <artifactId>spring-boot-starter-test</artifactId> > <scope>test</scope> > <exclusions> > <exclusion> > <groupId>org.junit.vintage</groupId> > <artifactId>junit-vintage-engine</artifactId> > </exclusion> > </exclusions> > </dependency> > </dependencies> > <build> > <plugins> > <plugin> > <groupId>org.springframework.boot</groupId> > <artifactId>spring-boot-maven-plugin</artifactId> > </plugin> > </plugins> > </build> > <repositories> > <repository> > <id>test</id> > <name>repo</name> > <releases> > <enabled>true</enabled> > </releases> > <snapshots> > <enabled>true</enabled> > </snapshots> > <url>https://repo.spring.io/libs-release</url> > </repository> > </repositories> > </project> > {code} > The theoretical maven remote repository priority is: > !image-2020-03-24-21-47-50-561.png|width=412,height=237! > However, when resolving a scope = import dependency, such as: > !image-2020-03-24-21-49-31-997.png|width=705,height=185! > The warehouse priority will become as shown in the figure below: > !image-2020-03-24-21-39-54-127.png|width=712,height=379! > Found that the central repository was reset to the default, and all > dependent downloads will become this repo priority in the future. > When resolving scope = import dependencies, this place will cause the > resolving repo to become the default central: > !image-2020-03-24-21-58-35-400.png|width=663,height=194! > !image-2020-03-24-21-57-58-635.png|width=1091,height=538! > Finally at this place, the default modelResoler repo will be replaced with > the default central: > !image-2020-03-24-22-00-08-867.png|width=912,height=194! > !image-2020-03-24-22-01-04-185.png|width=685,height=324! -- This message was sent by Atlassian Jira (v8.3.4#803005)