无法从发布回购下载依赖项工件

时间:2017-07-28 16:52:32

标签: maven deployment artifactory maven-release-plugin

我正在构建一个继承父模块的maven项目。

    <parent>
        <groupId>com.xxx.dist</groupId>
        <artifactId>com.xxx.dist.core.msp.service.pom</artifactId>
        <version>0.1-SNAPSHOT</version> <!-- 0.1 for release -->
    </parent>
    <artifactId>com.lgc.dist.core.msp.service.kafka</artifactId>

com.xxx.dist.core.msp.service.pom的工件发布在快照存储库(版本0.1-SNAPSHOT)和发布存储库(版本0.1)中。

运行

mvn deploy来部署快照。父pom可以成功下载:

[INFO] Downloading: https://repo.openearth.community/artifactory/distarch-maven-snapshots/com/xxx/dist/com.xxx.dist.core.msp.service.pom/0.1-SNAPSHOT/maven-metadata.xml
[INFO] Downloaded: https://repo.openearth.community/artifactory/distarch-maven-snapshots/com/xxx/dist/com.xxx.dist.core.msp.service.pom/0.1-SNAPSHOT/maven-metadata.xml (599 B at 1.9 KB/sec)
[INFO] Downloading: https://repo.openearth.community/artifactory/distarch-maven-snapshots/com/xxx/dist/com.xxx.dist.core.msp.service.pom/0.1-SNAPSHOT/com.xxx.dist.core.msp.service.pom-0.1-20170726.184445-38.pom
[INFO] Downloaded: https://repo.openearth.community/artifactory/distarch-maven-snapshots/com/xxx/dist/com.xxx.dist.core.msp.service.pom/0.1-SNAPSHOT/com.xxx.dist.core.msp.service.pom-0.1-20170726.184445-38.pom (14 KB at 664.4 KB/sec) 

对于使用maven发布插件的发布版本,它似乎无法从发布回购下载父pom:

[INFO] Downloading: https://repo.openearth.community/artifactory/distarch-maven-snapshots/com/xxx/dist/com.xxx.dist.core.msp.service.pom/0.1/com.xxx.dist.core.msp.service.pom-0.1.pom
[INFO] Downloading: https://repo.openearth.community/artifactory/distarch-maven-staging/com/xxx/dist/com.xxx.dist.core.msp.service.pom/0.1/com.xxx.dist.core.msp.service.pom-0.1.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.xxx.dist:com.xxx.dist.core.msp.service.kafka:[unknown-version]: Could not transfer artifact com.xxx.dist:com.lgc.dist.core.msp.service.pom:pom:0.1 from/to snapshots (https://repo.openearth.community/artifactory/distarch-maven-snapshots): Failed to transfer file: https://repo.openearth.community/artifactory/distarch-maven-snapshots/com/xxx/dist/com.xxx.dist.core.msp.service.pom/0.1/com.xxx.dist.core.msp.service.pom-0.1.pom. Return code is: 409 , ReasonPhrase:Conflict. and 'parent.relativePath' points at wrong local POM @ line 4, column 10

它试图在两个repos中查找工件,这些工件在maven的settings.xmldistarch-maven-snapshotsdistarch-maven-staging中定义。该错误可能有点误导,因为它指的是无法从快照repo而不是release发送。我以前见过这个,只是意味着它无法从snapshotsstaging转移。

在paging repo中确实存在0.1 pom artifactory 如果我只是将整个网址https://repo.openearth.community/artifactory/distarch-maven-staging/com/xxx/dist/com.xxx.dist.core.msp.service.pom/0.1/com.xxx.dist.core.msp.service.pom-0.1.pom粘贴到浏览器中,我就可以显示pom文件。 snapshotsstaging个repoes都在同一个Artifactory中设置。在快照回购工作时我无法从发行回购中获取的原因可能是什么。

1 个答案:

答案 0 :(得分:0)

似乎由于某种原因,POM被命名为错误:

  

com.lgc.dist.core.msp.service.pom-0.1.pom

应该命名为:

  

com.lgc.dist.core.msp.service-0.1.pom

你可以看到你有&#34; .pom-0.1.pom&#34;应该是&#34; -0.1.pom&#34;

你可以尝试改变它,看看它是否有效?