Java Maven 无法解析依赖项(返回代码为:409,ReasonPhrase:Conflict)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/42219560/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 00:01:25  来源:igfitidea点击:

Maven Could not resolve dependencies (Return code is: 409 , ReasonPhrase:Conflict)

javamavenwarartifactory

提问by Noman Ahmed

Failed to execute goal on project lcms.web:

无法在 lcms.web 项目上执行目标:

    Could not resolve dependencies for project lcms:lcms.web:war:0.0.1-SNAPSHOT: 
    Failed to collect dependencies for [junit:junit:jar:4.9 (test), org.springframework:spring-web:jar:4.2.4.RELEASE (compile), org.springframework:spring-webmvc:jar:4.2.4.RELEASE (compile), commons-logging:commons-logging:jar:1.1.1 (compile), 
org.springframework.security:spring-security-web:jar:4.0.3.RELEASE (compile), org.springframework.security:spring-security-config:jar:4.0.3.RELEASE (compile), org.springframework.security:spring-security-crypto:jar:4.0.3.RELEASE (compile), org.springframework.security:spring-security-ldap:jar:4.0.3.RELEASE (compile), commons-collections:commons-collections:jar:3.2.1 (compile), taglibs:standard:jar:1.1.2 (compile), commons-dbcp:commons-
dbcp:jar:20030825.184428 (compile), commons-pool:commons-pool:jar:20030825.183949 (compile), net.sourceforge.jtds:jtds:jar:1.3.1 (compile), org.springframework.ldap:spring-ldap-core:jar:2.0.4.RELEASE (compile), org.springframework.security:spring-security-cas:jar:4.0.3.RELEASE (compile), org.jasig.cas.client:cas-client-core:jar:3.1.12 (compile), com.googlecode.json-simple:json-simple:jar:1.1 (compile), org.slf4j:slf4j-api:jar:1.6.1 (compile), org.slf4j:slf4j-log4j12:jar:1.6.1 (compile), javax.servlet:javax.servlet-api:jar:3.0.1 (provided), cglib:cglib:jar:2.2 (compile), antlr:antlr:jar:2.7.7 (compile), lcmsdaomodel:lcms.dao.model:jar:1.1.1 (compile), 
com.fasterxml.Hymanson.core:Hymanson-core:jar:2.6.5 (compile),
 com.fasterxml.Hymanson.core:Hymanson-databind:jar:2.6.5 (compile), commons-fileupload:commons-fileupload:jar:1.3.1 (compile), org.apache.axis:axis-jaxrpc:jar:1.4 (compile), axis:axis:jar:1.4 (compile), org.apache.poi:poi:jar:3.10-FINAL (compile), com.jolbox:bonecp:jar:0.8.0.RELEASE (compile), org.springframework.ws:spring-ws-core:jar:2.0.3.RELEASE (compile), commons-httpclient:commons-httpclient:jar:3.1 (compile), net.sf.json-lib:json-lib:jar:jdk15:2.4 (compile), org.apache.httpcomponents:httpmime:jar:4.0.1 (compile)]: Failed to read artifact descriptor for lcmsdaomodel:lcms.dao.model:jar:1.1.1: Could not transfer artifact lcmsdaomodel:lcms.dao.model:pom:1.1.1 from/to snapshots (http://******/artifactory/ext-snapshot-local): Failed to transfer file: http://*******/artifactory/ext-snapshot-local/lcmsdaomodel/lcms.dao.model/1.1.1/lcms.dao.model-1.1.1.pom. Return code is: 409 , ReasonPhrase:Conflict. -> [Help 1]

采纳答案by Ariel

It seems that you are trying to resolve RELEASE artifact from a SNAPSHOT repository, therefore Artifactory is sending an error (409 conflict).

您似乎正在尝试从 SNAPSHOT 存储库解决 RELEASE 工件,因此 Artifactory 发送错误(409 冲突)。

You should direct your build to 'libs-releases' virtual repository, or any other virtual repository that holds only releases, so only repositories that hold release artifacts will be involved in the process of RELEASE artifact resolution

您应该将构建定向到“libs-releases”虚拟存储库,或任何其他仅包含发布的虚拟存储库,因此只有包含发布工件的存储库才会参与 RELEASE 工件解析过程

You can read heremore about resolution from Artifactory Maven repositories

您可以在此处阅读有关 Artifactory Maven 存储库解析的更多信息

回答by GauravJ

From your error details,

从您的错误详细信息,

Failed to transfer file: http://*******/artifactory/ext-snapshot-local/lcmsdaomodel/lcms.dao.model/1.1.1/lcms.dao.model-1.1.1.pom.
Return code is: 409 , ReasonPhrase:Conflict. -> [Help 1]

You have deployed a release version of lcms.dao.model in ext-snapshot-localwhich is only used to deploy manual snapshot of libraries. Check artifactory documentation.

您已经在ext-snapshot-local 中部署了 lcms.dao.model 的发布版本,该版本仅用于部署库的手动快照。检查神器文档

  1. If lcms.dao.modelis a released artifact, then login into your artifactory and delete entry for this library in Artifacts -> Tree Browser -> ext-snapshot-local. You need to have released version of this library in your artifactory.
  2. If this is snapshot version, you need to version your library as 1.1.1-SNAPSHOT
  1. 如果lcms.dao.model是已发布的工件,则登录您的工件并在工件 -> 树浏览器 -> ext-snapshot-local 中删除此库的条目。您需要在您的工件中发布此库的版本。
  2. 如果这是快照版本,则需要将库版本化为 1.1.1-SNAPSHOT

回答by Doctor Parameter

I had this problem and clearing out my .m2 directory fixed it.

我遇到了这个问题并清除了我的 .m2 目录修复了它。

回答by derwiwie

I received this error with the archiva repository directory of the artifact being incorrectly set such that archiva didn't have write access.

我收到此错误,因为工件的存档存储库目录设置不正确,以至于存档没有写访问权限。

回答by Ishfaq

I have the same error, I was deploying snapshot and snapshotRepository settings was not included in my main pom's distributionManagement. fix by adding snapshotRepository

我有同样的错误,我正在部署快照并且 snapshotRepository 设置没有包含在我的主 pom 的 distributionManagement 中。通过添加 snapshotRepository 修复

    <distributionManagement>
    <snapshotRepository>
        <id>snapshots</id>
        <name>libs-snapshot</name>
        <url>http://artifactory.private-apps.com/artifactory/libs-snapshot-local</url>
    </snapshotRepository>
</distributionManagement>