Reputation: 3367
I am trying to build a image from my spring-boot project.
This is my configuration for spring-boot maven plugin:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<image>
<name>abc/xyz-${project.artifactId}:${project.version}</name>
</image>
<pullPolicy>IF_NOT_PRESENT</pullPolicy>
</configuration>
</plugin>
</plugins>
</build>
But while building the image "spring-boot:build-image" from Eclipse to build a image giving me following error:
Could not find goal 'build-image' in plugin org.springframework.boot:spring-boot-maven-plugin:2.2.4.RELEASE among available goals build-info, help, repackage, run, start, stop -> [Help 1]
Not sure what exactly the issue is.
Thanks,
Atul
Upvotes: 1
Views: 2336
Reputation: 352
You need Spring Boot version 2.3.0.M1 or higher. The solution provided by @Atul above uses 2.4.2 so its a later version and has this feature.
For more information check this link
Upvotes: 0
Reputation: 3367
Found the issue and also able to solved it. The configuration needed :
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<image>
<name>abc/xyz-${project.artifactId}:${project.version}</name>
</image>
<pullPolicy>IF_NOT_PRESENT</pullPolicy>
</configuration>
</plugin>
</plugins>
</build>
Need to specify the version of sring-boot here. 2.4.2
Recently I was moved to version 2.4.2 spring boot version.
Thanks,
Atul
Upvotes: 0