Configuring pom.xml

Now, we will configure our pom.xml to be able to generate our Docker image. The first thing we need to change is our final name artifact because Docker images do not allow the - character, then we need to configure properly.

The configuration is pretty simple, put the <finalName> tag on the <build> node. Let's do that:

<build>  <finalName>tracked_hashtag</finalName>   ....</build>

Good. We have configured the final name properly to generate the Docker image correctly. Now, we will configure the Maven Docker plugin to generate the Docker image by the Maven goal.

In the plugins section inside the build node, we should put in the following plugin configuration:

<plugin>  <groupId>io.fabric8</groupId>  <artifactId>docker-maven-plugin ...

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.