Java 配置本地nexus服务器以从其他远程nexus存储库下载工件

Java 配置本地nexus服务器以从其他远程nexus存储库下载工件,java,maven,nexus,broadleaf-commerce,Java,Maven,Nexus,Broadleaf Commerce,我已经在本地安装了Nexus存储库,并将maven配置为使用我的Nexus repo。我试图安装broadleaf commerce,但总是出错。阔叶演示: 当我使用默认的maven设置文件构建项目时,我可以构建该项目。但是有了nexus local repo,我无法下载broadleaf工件。谁能帮我一下我的设置有什么问题吗 我的设置.xml <settings> <mirrors> <mirror> <!--This sends everythi

我已经在本地安装了Nexus存储库,并将maven配置为使用我的Nexus repo。我试图安装broadleaf commerce,但总是出错。阔叶演示:

当我使用默认的maven设置文件构建项目时,我可以构建该项目。但是有了nexus local repo,我无法下载broadleaf工件。谁能帮我一下我的设置有什么问题吗

我的设置.xml

<settings>
<mirrors>
<mirror>
  <!--This sends everything else to /public -->
  <id>nexus</id>
  <mirrorOf>*</mirrorOf>
  <url>http://localhost:8081/repository/maven-proxy-test/</url>
</mirror>
</mirrors>
<profiles>
<profile>
  <id>nexus</id>
  <!--Enable snapshots for the built in central repo to direct -->
  <!--all requests to nexus via the mirror -->
  <repositories>
    <repository>
      <id>central</id>
      <url>http://central</url>
      <releases><enabled>true</enabled></releases>
      <snapshots><enabled>true</enabled></snapshots>
    </repository>
<repository>
      <id>broadleaf-repo</id>
      <url>http://nexus.broadleafcommerce.org/nexus/content/groups/public</url>
      <releases><enabled>true</enabled></releases>
      <snapshots><enabled>true</enabled></snapshots>
   </repository>
  </repositories>
 <pluginRepositories>
    <pluginRepository>
      <id>central</id>
      <url>http://central</url>
      <releases><enabled>true</enabled></releases>
      <snapshots><enabled>true</enabled></snapshots>
    </pluginRepository>
<pluginRepository>
      <id>broadleaf-repo</id>
      <url>http://nexus.broadleafcommerce.org/nexus/content/groups/public</url>
      <releases><enabled>true</enabled></releases>
      <snapshots><enabled>true</enabled></snapshots>
    </pluginRepository>
  </pluginRepositories>
</profile>
 </profiles>
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>nexus</activeProfile>

你有两个选择,这取决于你想如何处理它

如果您的nexus还应保存BroadLeaveCommerce的工件,则必须将其添加为代理存储库:

在Nexus中创建一个ID为BroadLeaveCommerce、URL
http://nexus.broadleafcommerce.org/nexus/content/groups/public
和版本策略
混合
settings.xml中定义镜像:

<mirrors>
    <mirror>
      <id>nexus</id>
      <mirrorOf>*,!broadleaf-repo</mirrorOf>
      <url>http://localhost:8081/repository/maven-proxy-test/</url>
    </mirror>
    <mirror>
      <id>broadleafcommerce</id>
      <mirrorOf>broadleaf-repo</mirrorOf>
      <url>http://nexus.broadleafcommerce.org/nexus/content/groups/public/</url>
    </mirror>
</mirrors>

关系
*,!阔叶回购
http://localhost:8081/repository/maven-代理测试/
阔叶商业
阔叶回购
http://nexus.broadleafcommerce.org/nexus/content/groups/public/
如果您不想将BroadLeaveCommerce中的工件保存在nexus存储库中,请执行以下操作:

以这种方式定义镜像:

<mirrors>
    <mirror>
      <id>nexus-group</id>
      <mirrorOf>*,!broadleaf-repo</mirrorOf>
      <url>http://localhost:8081/repository/maven-proxy-test/</url>
    </mirror>
</mirrors>

nexus集团
*,!阔叶回购
http://localhost:8081/repository/maven-代理测试/
注意,
*,!broadleaf repo
指向已定义存储库的ID并将其排除

<mirrors>
    <mirror>
      <id>nexus-group</id>
      <mirrorOf>*,!broadleaf-repo</mirrorOf>
      <url>http://localhost:8081/repository/maven-proxy-test/</url>
    </mirror>
</mirrors>