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
  1. 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
  1. SQL > executions, executions, executions, executions, executions, executions, executions, executions
<executions>
    <execution>
        <goals>
            <goal>repackage</goal>
	</goals>
    </execution>
<executions>
Copy the code
  1. 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
  1. You can repack after clean

Reference: segmentfault.com/a/ [11900000…