Closed jacklaplante closed 8 years ago
I believe you can tackle this in one of two ways
<plugins>
section but default the plugin configuration to skip the docker build, and override that in the child module to not skipbuild
goal to the package
phase.I'm trying to get the docker build to skip by default by adding <skip>true</skip>
to <configuration>
but that isn't working. Is there a different way to do it?
The configuration property is named skipDockerBuild
, not skip
.
Thanks for the help! It's very much appreciated.
I am trying this approach: configure it only in the child module and bind the build goal to the package phase
But still getting the same error.
Here is the snippet of how the plugin is sourced in the child module: `
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.11</version>
<configuration>
<imageName>${docker.image.prefix}/${project.artifactId}</imageName>
<dockerDirectory>.</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
<executions>
<execution>
<id>docker-build</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
`
Please can you review ?
Any clear help on this on how to effectively build the docker image for a multi-module app?
@sachinlala
But still getting the same error.
can you clarify which error you are referring to?
Description
I want to use this docker-maven-plugin exclusively on one child module of my maven project.
How to reproduce
I tried putting the plugin only inside the pom of the child module. When I did
mvn clean package docker:build
it failed:[ERROR] No plugin found for prefix 'docker' in the current project and in the plugin groups
If I put the plugin anywhere inside the parent pom (in
<plugins>
orpluginManagement
) then it assumes that I'm making a docker container from the parent module and every child module.What do you expect
I only want one container from one child module.
Software: