报错信息:
[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:1.0.0:build (default-cli) on project ********: Exception caught: com.spotify.docker.client.shaded.com.fasterxml.jackson.databind.JsonMappingException: Can not
construct instance of com.spotify.docker.client.messages.RegistryAuth: no String-argument constructor/factory method to deserialize from String value ('desktop')
[ERROR] at [Source: N/A; line: -1, column: -1] (through reference chain: java.util.LinkedHashMap["credsStore"])
使用
docker-maven-plugin插件进行如下配置,
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.0.0</version>
<configuration>
<!-- 镜像名字 emotibot-southfund -->
<imageName>${project.artifactId}</imageName>
<!-- 指定dockerfile文件路径 -->
<dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>
<!-- 指定镜像版本标签 -->
<imageTags>
<imageTag>${project.version}</imageTag>
</imageTags>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.artifactId}-${project.version}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
执行命令mvn clean package docker:build命令报如下错误:
修改方案:
版本冲突,将version版本号修改为最新版本或者不冲突的版本,或者直接去掉verison标签,直接使用最近版本进行更新即可