maven docker出错的解决办法:1、maven项目修改为小写;2、重启docker服务;3、修改maven 账户配置信息。
本文操作环境:centos7系统、docker-maven-plugin 0.4.11版本、Dell G3电脑。
如何解决maven docker出错问题?
maven docker plugin 常见问题解决:
1. maven 项目必须使用小写,不然会一直有500 的错误
500: HTTP 500InternalServerError
2. docker server 连接数超了
Failed to execute goal com.spotify:docker-maven-plugin:0.4.11:build (default-cli) on project activityservice:Exception caught: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: java.io.IOException:No such file or directory
解决方法:
最简单的方法, 重启docker 服务
systemctl restart docker
3. maven 账户配置问题
<plugin> <groupId>com.spotify</groupId> <artifactId>docker-maven-plugin</artifactId> <version>0.4.11</version> <configuration> <imageName>XXXXXXXXXX/activitycenter/${project.artifactId}</imageName> <imageTags>activitycenter-${project.version}</imageTags> <dockerDirectory>src/main/docker</dockerDirectory> <serverId>docker-image</serverId> <useConfigFile>true</useConfigFile> <resources> <resource> <targetPath>/</targetPath> <directory>${project.build.directory}</directory> <include>${project.build.finalName}.jar</include> </resource> </resources> </configuration> </plugin>
serverId docker-image 配置信息账户信息:
<server> <id>docker-image</id> <username>admin</username> <password>XXXXX</password> <configuration> <email>XXXXXX@XXXXXX.com</email> </configuration> </server>
注意其中 email 的配置
推荐学习:《docker教程》