无法收集依赖项

时间:2015-09-24 20:22:19

标签: maven nexus

我只是想了解一些事情。假设我试图引入这种依赖

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.thirdwatch</groupId>
<artifactId>mvn-to-cpe</artifactId>
<version>1.0</version>
<dependencies>
    <dependency>
        <groupId>ch.racic.testing</groupId>
        <artifactId>test-configuration-manager</artifactId>
        <version>0.9.5</version>
        <exclusions>
            <exclusion>
                <groupId>*</groupId>
                <artifactId>*</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
</dependencies>
</project>

我收到以下错误

[ERROR] Failed to execute goal on project mvn-to-cpe: Could not resolve dependencies for project com.thirdwatch:mvn-to-cpe:jar:1.0: Failed to collect dependencies at ch.racic.testing:test-configuration-manager:jar:0.9.5: Failed to read artifact descriptor for ch.racic.testing:test-configuration-manager:jar:0.9.5: Failure to find ch.racic.testing:test-configuration-manager-parent:pom:0.9.5 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]

似乎缺少.jar。我们在最后使用的是Nexus服务器,这就是它显示的内容

enter image description here

我相信Nexus反映了Central Maven Repo,而中央maven似乎拥有它。

https://repo1.maven.org/maven2/ch/racic/testing/test-configuration-manager/0.9.5/

http://search.maven.org/#artifactdetails%7Cch.racic.testing%7Ctest-configuration-manager%7C0.9.5%7Cjar

这种差异的原因是什么? 我们是否正在镜像错误的maven存储库?

enter image description here

1 个答案:

答案 0 :(得分:1)

当切换到多模块项目时,pom文件中存在一个问题,它确实只是自动发布了核心工件......

现在已修复,0.13.2包含所有工件,不便之处,但单元测试没有涵盖那个,我已经注意到它安装运行良好,所以我可以在我的机器上使用它: - /