Open dadoonet opened 3 years ago
Thanks for reporting. I'll try to reproduce this and see if it's maven behavior or a bug in plugin itself. Do you have some sample reproducer project to try out?
@rohanKanojia Sadly not. But I could try to build one if you need it.
Description
mvn deploy
, docker plugin downloads the latest uploaded artifact from sonatype and does not use thefinalName
of the artifact.deploy
phase.So let me try to explain the behavior.
I have a project where I'm building the docker image within the
deploy
phase. (Which is probably a bad idea).I'm able to fix my build by splitting both phases (as shown below) but I think it's a bug that the behavior changes depending if you just have deployed or not the artifact before.
What is funny in this story, is that the behavior changes if you call maven with
-Dmaven.deploy.skip=true
. In that case, the artifact is not uploaded to OSS Sonatype and then the local version is actually used instead of the remote one. So the docker build is correct. 😄Info
mvn -v
) :Server: Docker Engine - Community Engine: Version: 20.10.5 API version: 1.41 (minimum version 1.12) Go version: go1.13.15 Git commit: 363e9a8 Built: Tue Mar 2 20:15:47 2021 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.4.3 GitCommit: 269548fa27e0089a8b8278fc4fc781d7f65a939b runc: Version: 1.0.0-rc92 GitCommit: ff819c7e9184c13b7c2607fe6c30ae19403a7aff docker-init: Version: 0.19.0 GitCommit: de40ad0