I have a Spring boot application which has many modules like error module, persistency, controllers etc like below
--Application
|
-- error module
|
-- controllers module
|
-- Persistancy module
|
-- .....
To build docker image for this using Maven jib plugin with below configuration in pom.xml
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>2.4.0</version>
<configuration>
<to>
<image>some.repo.io/my_name/jib-test</image>
</to>
<container>
<mainClass>com.a.b.c.Application</mainClass>
<ports>
<port>8080</port>
</ports>
</container>
</configuration>
</plugin>
Build is successful. But when I run the image, its throwing error Error: Could not find or load the main class com.a.b.c.Application.
How can I build the image using Jib ?. What am I missing here?
In your pom.xml, add:
Then run the following from your terminal: