问题是手动上传的工件,以释放无法从settings.xml
中定义的Nexus组存储库解析的存储库。
我已经尝试将http://localhost:8081/nexus/content/repositories/releases
存储库包含到/nexus/content/groups/public
存储库中,并将组存储库路径定义为settings.xml
中的镜像。
<settings>
.......
<mirrors>
<mirror>
<id>myteam-nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://localhost:8081/nexus/content/groups/public </url>
</mirror>
</mirrors>
.....
</settings>
在Nexus中,我的自定义JAR如下:
<dependency>
<groupId>com.xxxx.bank</groupId>
<artifactId>xxxxxcallws</artifactId>
<version>1.0</version>
</dependency>
<project>
<dependencies>
<dependency>
<groupId>com.xxxx.bank</groupId>
<artifactId>xxxxxcallws</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20160212</version>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<id>releases</id>
<!-- CHANGE HERE by your team nexus server -->
<url>http://localhost:8081/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<!-- CHANGE HERE by your team nexus server -->
<url>http://localhost:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
</project>
[当我运行mvn clean install -U
时出现错误提示:
在myteam-nexus(http://localhost:8081/nexus/content/groups/public)中找不到工件com.xxxx.bank:xxxxxcallws:jar:1.0
[注意:此JAR已上传到发布存储库(http://localhost:8081/nexus/content/repositories/releases)中,并且我已从Nexus管理员UI将相同的存储库添加到公共组存储库中。
但是以同样的方式,我将Maven Central代理添加到公共组中,而来自Central的依赖关系也在拉动,但是我上传的JAR无法通过公共存储库找到位置。