如何从Gradle发布到Nexus时修复此错误

时间:2014-09-25 22:34:59

标签: maven gradle nexus

我收到了错误

Error deploying artifact 'au.com.company:library:jar': Error deploying artifact: Resource to deploy not found: File: http://nexus:8081/content/repositories/snapshots/au/com/company/library/2.1-SNAPSHOT/library-2.1-20140925.222243-1.jar does not exist

使用以下命令从Gradle发布到Maven时:

gradle publish

是什么导致这种情况?

1 个答案:

答案 0 :(得分:3)

所以这是由无效的网址引起的。我在build.gradle文件中有这个:

http://nexus:8081/content/repositories/snapshots

我需要这个:

http://nexus:8081/nexus/content/repositories/snapshots

您必须仔细查看--debug日志以查看此错误:

[DEBUG] [sun.net.www.protocol.http.HttpURLConnection] sun.net.www.MessageHeader@274364f26 pairs: {null: HTTP/1.1 404 Not Found}{Date: Thu, 25 Sep 2014 22:25:16 GMT}{Cache-Control: must-revalidate,no-cache,no-store}{Content-Type: text/html;charset=ISO-8859-1}{Content-Length: 1370}{Server: Jetty(8.1.11.v20130520)}