首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从Maven中的两个镜像下载依赖项时出错

从Maven中的两个镜像下载依赖项时出错
EN

Stack Overflow用户
提问于 2021-04-27 07:25:22
回答 1查看 206关注 0票数 0

我想从maven镜像下载春土生依赖项,因为它不在我的第三方镜像中,我试图通过在我的settings.xml文件中包含maven镜像来实现它,但是它不起作用。

Settings.xml文件-

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<settings>
   <mirrors>
      <mirror>
         <id>artifactory</id>
         <mirrorOf>*</mirrorOf>
         <url>https://thirdparty.com/artifactory</url>
      </mirror>
      <mirror>
         <id>MavenCentral</id>       
         <url>https://repo.maven.apache.org/maven2</url>
         <mirrorOf>central</mirrorOf>
      </mirror>
   </mirrors>
   <profiles>
      <profile>
         <id>artifactory</id>
         <repositories>
            <repository>
               <id>central</id>
               <url>http://central</url>
               <releases>
                  <enabled>true</enabled>
               </releases>
               <snapshots>
                  <enabled>true</enabled>
               </snapshots>
            </repository>
            <repository>
               <id>MavenCentral</id>
               <url>https://repo.maven.apache.org/maven2/</url>
            </repository>
         </repositories>
         <pluginRepositories>
            <pluginRepository>
               <id>central</id>
               <url>http://central</url>
               <releases>
                  <enabled>true</enabled>
               </releases>
               <snapshots>
                  <enabled>true</enabled>
               </snapshots>
            </pluginRepository>
         </pluginRepositories>
      </profile>
   </profiles>
   <activeProfiles>
      <activeProfile>artifactory</activeProfile>
   </activeProfiles>
</settings>

我增加了这种依赖性-

代码语言:javascript
复制
<dependency>
    <groupId>org.springframework.experimental</groupId>
    <artifactId>spring-native</artifactId>
    <version>0.9.2</version>
</dependency>

问题-不能解决org.springframework.experimental:spring-native:0.9.2如何解决这个问题?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-04-27 07:31:35

当您使用<mirrorof>*<mirrorof>时,您实际上覆盖了所有其他镜像和存储库定义。若要将存储库从镜像中排除在外,请使用

*,!otherrepo

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67278644

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档