當用maven build項目時出現了如下錯誤:
Failed to execute goal com.spotify:docker-maven-plugin:0.4.13:build (default-cli) on project config: Exception caught: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:2375 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused
多方查找資料,最后發現,原來是自己的docker沒裝,也是醉了。
所以以后大家也出現了這種錯誤,原因可能:
1.沒安裝docker
2.如果安裝了docker的話,可能docker的daemon沒有運行
解決辦法:
1.安裝docker,docker官網有詳細步驟
2.開啟docker的守護進程,在linux上,運行
1 systemctl start docker.service
再查資料的過程中找到與我類似的錯誤的一篇博客:http://blog.csdn.net/chinamcafee/article/details/66974686
其報錯是:
Failed to execute goal com.spotify:docker-maven-plugin:0.2.9:build (default-cli) on project config: Exception caught: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:2375 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused
解決辦法:
把docker-maven-plugin版本更新成0.4.13即可