springboot项目构建docker镜像异常: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded

异常信息

在centos上构建springboot项目的docker镜像时出现以下异常:

Failed to execute goal com.spotify:docker-maven-plugin:1.0.0:build (default-cli) on project dockerDemo: Exception caught: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: org.apache.http.client.ClientProtocolException: Cannot retry request with a non-repeatable request entity: Connection reset by peer -> [Help 1]

使用的是docker-maven插件,pom.xml配置如下:


	com.spotify
	docker-maven-plugin
	1.0.0
	
		${docker.image.prefix}/${project.artifactId}
		src/main/docker
		
			
				/
				${project.build.directory}
				${project.build.finalName}.jar
			
		
	

解决方法

把要构建的镜像名称全部改为小写,这里配置为${docker.image.prefix}/${project.artifactId},所以要保证项目的artifactId为小写。
方案来源:
springboot项目构建docker镜像异常: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded_第1张图片
issue地址:https://github.com/spotify/docker-maven-plugin/issues/357

你可能感兴趣的:(异常处理)