Solution: Error: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.4.4:repackage (repackage)

If you have come across this error when trying to build and deploy your Spring Boot Maven application then this post will help you!

Error: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.4.4:repackage (repackage)

How to fix the Repackage Execute Goal Error

You need to make sure you have the mainClass explicitly defined under your build->plugin as follows:

<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <mainClass>com.example.apps.YourApplication</mainClass> </configuration> </plugin> </plugins> </build>
Code language: HTML, XML (xml)
Subscribe
Notify of
guest
1 Comment
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
Gabriel Santana
Gabriel Santana
3 days ago

This solved my issue. Thank you!