For a multimodule maven project build using com.spotify:dockerfile-maven-plugin on a CI runner, building the docker image with dockerfile:build dockerfile:tag in a previous step, and running mvn clean deploy dockerfile:push in deploy step results in an error:
Failed to execute goal com.spotify:dockerfile-maven-
plugin:VERSION:tag (default-cli) on project PROJECT_NAME: Execution
default-cli of goal com.spotify:dockerfile-maven-plugin:VERSION:tag
failed: path is 'null'.
Logs:
Tagging image null as REPO_NAME/IMAGE_NAME
Evidently, the built image isn't getting tagged properly.
pom.xml:
<configuration>
<repository>${prefix}/${project.artifactId}</repository>
<tag>${tag}</tag>
<buildArgs>
<JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
<skip>false</skip>
</configuration>
But I can't really find what I'm doing wrong.
Running
docker image liston the CI runner after the supposed build and tag step revealed that no image was built or tagged. Missing image causes the above error, which isn't really documented on the searchable internet.The build step for the CI showed completed successfully, but no
mvn clean package dockerfile:buildwas called (because of a hidden condition).Probably too specific of a resolution to help anybody else, but at least the error message is out there in the internet now.