如何解决Maven中的“无法收集依赖项”错误?

pgvzfuti  于 2022-12-22  发布在  Maven
关注(0)|答案(2)|浏览(234)

I'm using Maven 3 in my project. It's been sitting on the shelf for a while, but we recently started working on it again.
When I try to build it I'm getting the following error:
[ERROR] Failed to execute goal on project tahrir:
Could not resolve dependencies for project tahrirproject:tahrir:jar:0.0.1-SNAPSHOT:
Failed to collect dependencies for [com.google.code.gson:gson:jar:2.2.2 (compile), org.apache.commons:commons-math3:jar:3.0 (compile), args4j:args4j:jar:2.0.16 (compile), org.testng:testng:jar:5.14 (test), bouncycastle:bcprov-jdk16:jar:140 (compile), com.google.guava:guava:jar:13.0 (compile), ch.qos.logback:logback-classic:jar:0.9.28 (compile), com.miglayout:miglayout:jar:3.7.4 (compile), org.datanucleus:datanucleus-db4o:jar:3.0.0-m3 (compile), joda-time:joda-time:jar:1.6.2 (compile), com.google.inject:guice:jar:3.0 (compile), com.seaglasslookandfeel:seaglasslookandfeel:jar:0.2 (compile), xom:xom:jar:1.2.5 (compile), commons-codec:commons-codec:jar:1.6 (compile), org.apache.commons:commons-lang3:jar:3.1 (compile)]:
Failed to read artifact descriptor for db4o:db4o:jar:7.12.126.14142-all-java5: Could not transfer artifact db4o:db4o:pom:7.12.126.14142-all-java5 from/to local.repository (file:../../local.repository/trunk):
No connector available to access repository local.repository (file:../../local.repository/trunk) of type legacy using the available factories WagonRepositoryConnectorFactory -> [Help 1]
Here is my pom.xml file: https://github.com/sanity/tahrir/blob/master/pom.xml
I've seen that this can be related to trying to access Maven 1 or 2 repositories from Maven 3. If this is the issue I'd prefer to only use Maven 3 respositories, yet currently all of the dependencies I'm specifying should be in the default Maven repository, so I'm not sure what the issue is.
Any specific advice about how to properly "fix" our pom.xml file would be greatly appreciated.

oknrviil

oknrviil1#

在检查包含工件但在不同坐标下的存储库后,这意味着您必须像这样更改给定的pom:

<repositories>
    <repository>
      <id>source.db4o</id>
      <url>http://source.db4o.com/maven</url>
    </repository>
  </repositories>
  ...
  <dependencies>
    <dependency>
      <groupId>com.db4o</groupId>
      <artifactId>db4o-full-java5</artifactId>
      <version>8.1-SNAPSHOT</version>
    </dependency>
    ...
  </dependencies>
</project>

如果你看一下存储库,你会发现问题所在,但是我建议不要使用SNAPSHOT的better use releases文件。

brqmpdu1

brqmpdu12#

我们遇到了类似的问题,并通过添加一个旅行车扩展来修复它:

<build>
    <extensions>
        <extension>
            <groupId>org.apache.maven.wagon</groupId>
            <artifactId>wagon-ssh</artifactId>
            <version>1.0</version>
        </extension>
    </extensions>
    ....
</build>

相关问题