Maven 3.5.2 cannot deploy artifact to Artifactory with error 417

可紊 提交于 2019-12-04 05:53:42

Since the root cause is

[DEBUG] http-outgoing-0 << "<h1>Expectation Failed</h1>[\n]"
[DEBUG] http-outgoing-0 << "<p>The expectation given in the Expect request-header[\n]"
[DEBUG] http-outgoing-0 << "field could not be met by this server.[\n]"
[DEBUG] http-outgoing-0 << "The client sent<pre>[\n]"
[DEBUG] http-outgoing-0 << "    Expect: 100-continue[\n]"
[DEBUG] http-outgoing-0 << "</pre>[\n]"
[DEBUG] http-outgoing-0 << "</p><p>Only the 100-continue expectation is supported.</p>[\n]"
[DEBUG] http-outgoing-0 << "</body></html>[\n]"
[DEBUG] http-outgoing-0 << HTTP/1.1 417 Expectation Failed

The StackOverflow answer advise to remove the Expect header by setting the Apache httpd.conf as

<IfModule mod_headers.c>
    RequestHeader unset Expect early
</IfModule>

At the moment I can execute the mvn clean deploy by using the Maven 3.5.2 properly.

If you can not fix your current problem, you can try other deployment mechanisms like maven Artifactory plugin or deploying from CI. In one of Artifactory's blog posts it is advised to deploy from Jenkins(or other CI in non-cloud environments) to aquire cleaner pom.xml's. https://www.jfrog.com/confluence/display/RTF/Maven+Artifactory+Plugin https://jfrog.com/blog/dont-let-maven-deploy-plugin-trip-you/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!