-
Notifications
You must be signed in to change notification settings - Fork 493
Artifact not copied when using Maven ${project.build.directory}
property
#101
Comments
I’d suggest taking a look at the output of mvn help:effective-pom. Possibly the /home/jjjjeee path is not inside the docker context which is sent to the docker daemon (do you expect that to look like an absolute path?). |
Good idea, I will do this. |
@mattnworb It makes sense now! With:
It holds the value: With:
It holds the value: And that is indeed in the docker context, as you thought. Is there a way to configure this context when using |
You can set dockerfile-maven/plugin/src/main/java/com/spotify/plugin/dockerfile/BuildMojo.java Lines 48 to 54 in 59c93a1
|
@mattnworb Isn't this some kind of bug then? The basedir is set to Shouldn't we be smart enough to translate this absolute path in to the relative path |
I wouldn't classify this as a bug in dockerfile-maven, as it is docker itself that requires that the paths in the Dockerfile be relative paths to the context. See moby/moby#4592 as a reference. Absolute paths in the Dockerfile would make your build a lot less portable, for instance. For example:
|
I would agree that the fact that the Maven property |
Hi,
I am really confused by the following issue. I need your help :).
I have a parent pom, which is used for all my war projects. In this parent pom, I have:
Now, in the child poms, which are war projects, I can do:
This works really great. As an example, a
Dockerfile
looks like this:Now to my bug. In the parent pom, if I replace
by
this is no longer working. I get the following exception:
[ERROR] ADD failed: stat /var/lib/docker/tmp/docker-builder028011685/home/jjjjeee/projects/my-project/target/my-project-1.0.0-SNAPSHOT.war: no such file or directory
However, that file exists. That would also have been the file if I just did
target/${project.build.finalName}.${project.packaging}
instead of the not working${project.build.directory}/${project.build.finalName}.${project.packaging}
.Any ideas? This is really confusing me.
Thanks a lot!
The text was updated successfully, but these errors were encountered: