There is no master list attribute in the JAR
Maven-based Springboot project package jar file, run Java -jar xxx-0.0.1 -snapshot. jar error message, jar does not have the main listCopy the code
- Cause 1, it is not added in the POM.xml file
<build> <plugins> <plugin> <! -- Build an executable JAR --> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build>Copy the code
- SQL > executions, executions, executions, executions, executions, executions, executions, executions
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
<executions>
Copy the code
- The complete build module is as follows, added to pom.xml:
<build> <plugins> <plugin> <! -- Build an executable JAR --> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <executions> <execution> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> </plugins> </build>Copy the code
- You can repack after clean
Reference: segmentfault.com/a/ [11900000…