启动mvn clean install vagrant:up后出现以下错误:

Downloading: https://oss.sonatype.org/content/repositories/snapshots/org/apache/avalon/framework/avalon-framework-api/4.2.0/avalon-framework-api-4.2.0.pom
[INFO] Unable to find resource 'org.apache.avalon.framework:avalon-framework-api:pom:4.2.0' in repository snapshot-repository (https://oss.sonatype.org/content/repositories/snapshots)
Downloading: http://central.maven.org/maven2/org/apache/avalon/framework/avalon-framework-api/4.2.0/avalon-framework-api-4.2.0.pom
[INFO] Unable to find resource 'org.apache.avalon.framework:avalon-framework-api:pom:4.2.0' in repository Avalon-repo (http://central.maven.org/maven2)
Downloading: http://repo1.maven.org/maven2/org/apache/avalon/framework/avalon-framework-api/4.2.0/avalon-framework-api-4.2.0.pom
[INFO] Unable to find resource 'org.apache.avalon.framework:avalon-framework-api:pom:4.2.0' in repository central (http://repo1.maven.org/maven2)
Downloading: https://oss.sonatype.org/content/repositories/snapshots/org/apache/avalon/framework/avalon-framework-impl/4.2.0/avalon-framework-impl-4.2.0.pom
[INFO] Unable to find resource 'org.apache.avalon.framework:avalon-framework-impl:pom:4.2.0' in repository snapshot-repository (https://oss.sonatype.org/content/repositories/snapshots)
Downloading: http://central.maven.org/maven2/org/apache/avalon/framework/avalon-framework-impl/4.2.0/avalon-framework-impl-4.2.0.pom
[INFO] Unable to find resource 'org.apache.avalon.framework:avalon-framework-impl:pom:4.2.0' in repository Avalon-repo (http://central.maven.org/maven2)
Downloading: http://repo1.maven.org/maven2/org/apache/avalon/framework/avalon-framework-impl/4.2.0/avalon-framework-impl-4.2.0.pom
[INFO] Unable to find resource 'org.apache.avalon.framework:avalon-framework-impl:pom:4.2.0' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Unable to get dependency information: Error in metadata for artifact 'rubygems:vagrant:gem': Unable to parse version '[0.5.2,0.5.2.0.0.0.0.1)' for dependency 'rubygems:archive-tar-minitar:gem': Range defies version ordering: [0.5.2,0.5.2.0.0.0.0.1)
  rubygems:vagrant:gem:1.0.7

from the specified remote repositories:
  central (http://repo1.maven.org/maven2),
  rubygems (http://rubygems-proxy.torquebox.org/releases),
  snapshot-repository (https://oss.sonatype.org/content/repositories/snapshots),
  Avalon-repo (http://central.maven.org/maven2)

Path to dependency:
    1) downloader:downloader:jar:0.0.1-SNAPSHOT
    2) net.ju-n.maven.plugins:vagrant-maven-plugin:maven-plugin:1.0.1


我已经搜索了此依赖关系,并在另一个URL中找到了它,但是我不知道如何设置它。我不想手动下载jar,因为我们使用的是Jenkins,但我无权访问该存储库。

有人知道如何解决吗?

谢谢!!

附言我的pom.xml是(部分):

<dependency>
  <groupId>net.ju-n.maven.plugins</groupId>
  <artifactId>vagrant-maven-plugin</artifactId>
  <version>1.0.1</version>
  <type>maven-plugin</type>
</dependency>
<dependency>
  <groupId>de.saumya.mojo</groupId>
  <artifactId>gem-maven-plugin</artifactId>
  <version>1.0.7</version>
</dependency>
<dependency>
  <groupId>avalon-framework</groupId>
  <artifactId>avalon-framework-impl</artifactId>
  <version>4.2.0</version>
  <optional>true</optional>
</dependency>


Update1:​​我的pom.xml中包含以下存储库:

<repositories>
    <repository>
        <id>snapshot-repository</id>
        <name>Maven2 Snapshot Repository</name>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>daily</updatePolicy>
        </snapshots>
    </repository>

    <repository>
      <id>Avalon-repo</id>
      <url>http://central.maven.org/maven2</url>
    </repository>
  </repositories>


Update2:Maven在http://repo1.maven.org/maven2/org/apache/avalon/framework/avalon-framework-impl/4.2.0/avalon-framework-impl-4.2.0.pom中寻找依赖项的问题,但正确的URL是:https://repo1.maven.org/maven2/avalon-framework/avalon-framework-api/4.2.0/avalon-framework-api-4.2.0.pom

最佳答案

您的settings.xm文件夹下有一个.m2 l。您必须在此处添加存储库,如下所示:

</repository>
                  <repository>
                      <id>central</id>
                      <name>Maven Repository Switchboard</name>
                      <url>http://repo1.maven.org/maven2</url>
                      <snapshots>
                        <enabled>false</enabled>
                      </snapshots>
                    </repository>

07-24 09:18