When spring boot performs the packaging operation, the following errors are reported:
Execution default of goal org.springframework.boot:spring-boot-maven-plugin:XXXX RELEASE:repackage failed: Unable to find main class
The root cause is that in my project scenario,
Only the – boot sub module as shown in the figure produces executable jar packages. Other modules do not need to be executable. In my root POM, spring boot helps me add the following build strategy by default
< build>
& lt; plugins>
& lt; plugin>
& lt; groupId> org.springframework.boot
& lt; artifactId> spring-boot-maven-plugin
& lt;/ plugin>
& lt;/ plugins>
& lt;/ build>
The solution is relatively simple, that is, remove the build part of the Spirng boot for all modules and put it into the sub module you need to package. Here is the API service boot module, Other modules do not need to produce executable jars.
————–
copyright notice: This article is an original article of CSDN blogger “@ within” and follows the CC 4.0 by-sa copyright agreement. Please attach the source link of the original text and this notice for reprint
original link: https://blog.csdn.net/qq_ 41264674/article/details/106539584
Read More:
- [Solved] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test
- Cannot resolve plugin org.springframework .boot:xxx
- [ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on pr
- Failed to execute goal org.apache.maven . plugins:maven-surefire-plugin :2.12.4:test
- RocketMQ Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check…
- Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.6:sign
- Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile)
- Spring boot problem 1: error reporting life processing instructions for building a spring boot project
- 解决Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile
- Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test)
- Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.9.1:jar (default) on project
- Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (default-cli) on project Hello
- Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0
- Failed to execute goal org.apache.maven . plugins:maven-clean-plugin :2.6.1:cle
- Failed to execute goal org.apache.tomcat . maven:tomcat7-maven-plugin : 2.2: run solution
- Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:3.0.0:clean (default-clean) on
- How to Fix Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile
- Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:run (default-cli) on project
- The spring boot project was first created, pom.xml The error is Maven configuration problem. How to solve it?
- Failed to execute goal in Maven build org.apache.tomcat .maven: