Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Maven多存储库-jcenter、nexus_Maven_Nexus_Bintray_Jcenter - Fatal编程技术网

Maven多存储库-jcenter、nexus

Maven多存储库-jcenter、nexus,maven,nexus,bintray,jcenter,Maven,Nexus,Bintray,Jcenter,我正在尝试用两个存储库设置maven—jcenter和nexus。从nexus,我们无法代理到jcenter。因此,我需要一个可以执行以下操作的设置- 如果在nexus中找到工件,请下载它 如果找不到,请转到jcenter下载工件 使用下面的settings.xml,maven似乎只尝试从central下载(这里设置为bintray,因为它是maven central的超集)。我怎样才能让maven看看central和nexus 注意-我已经尝试了central!nexus 垃圾箱 垃圾箱

我正在尝试用两个存储库设置maven—jcenter和nexus。从nexus,我们无法代理到jcenter。因此,我需要一个可以执行以下操作的设置-

  • 如果在nexus中找到工件,请下载它
  • 如果找不到,请转到jcenter下载工件
使用下面的settings.xml,maven似乎只尝试从central下载(这里设置为bintray,因为它是maven central的超集)。我怎样才能让maven看看central和nexus

注意-我已经尝试了
central!nexus


垃圾箱
垃圾箱
http://jcenter.bintray.com
中心的
关系
!垃圾箱*
http://some/url/goes/here
允许快照
真的
jcenter
http://jcenter.bintray.com

我通过在我的父pom中指定多个回购来实现它。settings.xml中的多个repo对maven没有影响

请查看是否有帮助谢谢,我已经访问了该网站并更新了我的settings.xml,但对我不起作用。“!bintray,*”将起作用,前提是您在settings.xml文件中有一个ID为“bintray”的存储库定义。不过,我不确定星号前面的领先位置,这可能是个问题?rseddon,谢谢,我没有意识到这个位置可能是个问题。我会检查它,并让你知道我是否幸运。这是我的存储库设置,我没有幸运地更正了空间。您是否看到任何需要更正的设置<代码>允许快照为真http://jcenter.bintray.com 真-真
 <mirrors>
   <mirror>
      <id>bintray</id>
      <name>bintray</name>
      <url>http://jcenter.bintray.com</url>
      <mirrorOf>central</mirrorOf>
    </mirror>
    <mirror>
      <id>nexus</id>
      <mirrorOf>!bintray, *</mirrorOf>
      <url>http://some/url/goes/here</url>
    </mirror>
  </mirrors>

  <profiles>
    <profile>
      <id>allow-snapshots</id>
      <activation><activeByDefault>true</activeByDefault></activation>
      <repositories>
        <repository>
            <id>jcenter</id>
            <url>http://jcenter.bintray.com</url>
        </repository>
      </repositories>
    </profile>
  </profiles>