After the springboot project is packaged as a jar, it is reported to find the main method, classnotfound
Add the following plug-in to the POM of the modules that report the error.
<build>
<plugins>
<!-- If you don't add this parameter to the jar package, it will report that the main method was not found. -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<includeSystemScope>true</includeSystemScope>
<mainClass>cn.vantee.EurekaServerStarter7001</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Similar Posts:
- Unable to find a single main class from the following candidates [xxx,xxx]
- Remove dependency-reduced-pom.xml file when packaging Maven project
- Maven no main manifest attribute when generate jar for project
- [Solved] The updated version of springboot causes no main manifest attribute
- Run jar file under Linux system, prompt: no main manifest attribute, in xxx.jar [How to Solve]
- Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace
- [Solved] Spring Boot Package Error: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0
- [Solved] SpringBoot Package Error: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-res
- Springboot introduces local jar package to deploy to server error [How to Solve]
- Intellij Pack the jar file error: “java.lang.SecurityException: Invalid signature file digest for Manifest main attrib