After the project is packaged by maven, use the java -jar
command to run, prompting the following error:
pocket@mac java -jar eureka-server-1.0-SNAPSHOT.jar --spring.profiles.active=peer1
eureka-server-1.0-SNAPSHOT.jar中没有主清单属性
Solution:
Add the plugin to the pom file and spring-boot-maven-plugin
repackage it:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>