Closed nhooey closed 5 years ago
I get the following error:
[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:1.2.0:build (default-cli) on project project-name: Exception caught: You must specify an "imageName" in your docker-maven-client's plugin configuration -> [Help 1]
Run this:
mvn package docker:build -DdockerDirectory=. -DimageName=image-name
With this configuration in the pom.xml:
pom.xml
<plugin> <groupId>com.spotify</groupId> <artifactId>dockerfile-maven-plugin</artifactId> <version>${dockerfile-maven-version}</version> <executions> <execution> <id>build</id> <goals> <goal>build</goal> </goals> <configuration> <imageName>repository.tld/${project.artifactId}:${project.version}</imageName> </configuration> </execution> <execution> <id>default</id> <goals> <goal>build</goal> <goal>push</goal> </goals> <configuration> <imageName>repository.tld/${project.artifactId}:${project.version}</imageName> </configuration> </execution> <execution> <id>push-image</id> <phase>deploy</phase> <goals> <goal>push</goal> </goals> <configuration> <imageName>repository.tld/${project.artifactId}:${project.version}</imageName> </configuration> </execution> </executions> <configuration> <imageName>repository.tld/${project.artifactId}:${project.version}</imageName> <repository>bigterminal.azurecr.io/${project.artifactId}</repository> <tag>${project.version}</tag> <buildArgs> <JAR_FILE>${project.build.finalName}.jar</JAR_FILE> </buildArgs> <useMavenSettingsForAuth>true</useMavenSettingsForAuth> </configuration> </plugin>
A less useless error message should appear saying exactly where this imageName variable should be defined.
imageName
-D
The error message seems to contradict what has already been done.
Docker version 18.03.1-ce, build 9ee9f40
<dockerfile-maven-version>1.4.9</dockerfile-maven-version>
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T14:41:47-04:00)
Description
I get the following error:
How to reproduce
Run this:
With this configuration in the
pom.xml
:What do you expect
A less useless error message should appear saying exactly where this
imageName
variable should be defined.pom.xml
file should it be under?-D
define on exactly what command can it be configured from?What happened instead
The error message seems to contradict what has already been done.
Software:
Docker version 18.03.1-ce, build 9ee9f40
<dockerfile-maven-version>1.4.9</dockerfile-maven-version>
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T14:41:47-04:00)