spring boot packaging problem

[INFO] Final Memory: 17M/225M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.0.RELEASE:repackage (default) on project demo-service: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:2.0.0.RELEASE:repackage failed: Unable to find main class -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

Process finished with exit code 1

 

The reason for this error is

<build> 
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
this plugin, The spring-boot-maven-plugin is introduced here. When packaging, it will scan the main method entry of the project. That is to say, to introduce this configuration, you must create a spring-boot startup class under the project src/main/java/:

solution:

1. Add the spring-boot startup class.

2. Comment out the spring-boot-maven-plugin related configuration in pom.xml

3. The spring-boot-maven-plugin related configuration in pom.xml can be modified to the ordinary maven--plugin configuration.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325022567&siteId=291194637