Maven无法从远程存储库下载 [英] Maven unable to download from remote repository
问题描述
我正在尝试构建一个依赖于 SVNKit 的 Maven 模块.
I'm trying to build a Maven module that depends on SVNKit.
所以我的 pom.xml 看起来像这样:
So my pom.xml looks like this:
<dependencies>
<dependency>
<groupId>org.tmatesoft.svnkit</groupId>
<artifactId>svnkit</artifactId>
<version>1.3.7</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>tmatesoft-releases</id>
<url>http://maven.tmatesoft.com/content/repositories/releases/</url>
</repository>
</repositories>
当我尝试进行 mvn 全新安装时,它似乎试图查看 Nexus 存储库,但显然找不到它.我显然试图从远程存储库下载工件:http://maven.tmatesoft.com/content/repositories/releases
When I try to do a mvn clean install, it looks like it attemps to look into a Nexus repository, and obviously cannot find it. I'm obviously trying to download the artifact from a remote repository at: http://maven.tmatesoft.com/content/repositories/releases
我查看了 ~/.m2/文件夹中的 settings.xml 文件,我看到有一个看起来像这样的镜像:
I took a look at my settings.xml file in my ~/.m2/ folder and I see that there is a mirror that looks like this:
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://Our_Nexus_Repository</url>
</mirror>
我认为,如果你定义了一个
标签,你的模块的 pom.xml 将优先于你的 settings.xml 文件中定义的内容.
I thought that, if you define a <reposotiry>
tag, your module's pom.xml will take precedence over what's defined in your settings.xml file.
感谢任何帮助.谢谢.
推荐答案
这是因为镜像会镜像所有仓库,:
this is because the mirror will mirror all the repositories, : <mirrorOf>*</mirrorOf>
您可以像这样更改替换它:<mirrorOf>*,!tmatesoft-releases</mirrorOf>
you can change replace it like this : <mirrorOf>*,!tmatesoft-releases</mirrorOf>
更多信息请访问:http://maven.apache.org/guides/mini/guide-mirror-settings.html
这篇关于Maven无法从远程存储库下载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!