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:
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.3.6</version>
<executions>
<execution>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
<configuration>
<repository>${project.groupId}/${project.artifactId}</repository>
<tag>${project.version}</tag>
<buildArgs>
<ARTIFACT>target/${project.build.finalName}.${project.packaging}</ARTIFACT>
</buildArgs>
</configuration>
</plugin>
Now, in the child poms, which are war projects, I can do:
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
</plugin>
This works really great. As an example, a Dockerfile
looks like this:
FROM tomcat
ARG ARTIFACT
ADD ${ARTIFACT} /usr/local/tomcat/webapps/my-project.war
Now to my bug. In the parent pom, if I replace
<buildArgs>
<ARTIFACT>target/${project.build.finalName}.${project.packaging}</ARTIFACT>
</buildArgs>
by
<buildArgs>
<ARTIFACT>${project.build.directory}/${project.build.finalName}.${project.packaging}</ARTIFACT>
</buildArgs>
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!