上传到Nexus的自定义JAR无法从settings.xml中定义的Nexus公共组解析

问题描述 投票:0回答:1

问题是手动上传的工件,以释放无法从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>

pom.xml

<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无法通过公共存储库找到位置。

maven maven-2 pom.xml nexus dependency-management
1个回答
0
投票

[当您手动上传jar时,Nexus会自动添加分类器。从nexus移除现有的jar,然后在没有分类器的情况下再次上传。

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.