Adding the plugin on pom.xml

Let's configure the Maven plugin. It is necessary to add a plugin to the plugin section on our pom.xml and add some configurations. The plugin should be configured as follows:

<plugin>   <groupId>io.fabric8</groupId>   <artifactId>docker-maven-plugin</artifactId>   <version>0.21.0</version>   <configuration>      <images>         <image>            <name>springfivebyexample/${project.build.finalName}</name>             <build>               <from>openjdk:latest</from>               <entryPoint>java -Dspring.profiles.active=container -jar /application/${project.build.finalName}.jar</entryPoint>               <assembly>                  <basedir>/application</basedir>                  <descriptorRef>artifact</descriptorRef>                  <inline>                     <id>assembly</id>                     <files>                        <file>                           <source>target/${project.build.finalName}.jar</source>                        </file>

Get Spring 5.0 By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.