spring cloud打包运行报错:no main manifest attribute
修改pom.xml
原因,需要在子module模块的pom.xml文件中添加插件依赖:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!-- 指定该Main Class为全局的唯一入口 -->
<mainClass>com.mooc.house.eurekaserver.EurekaSeverApplication</mainClass>
<layout>ZIP</layout>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal><!--可以把依赖的包都打包到生成的Jar包中-->
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
启动程序
java -jar eureka-sever-1.0.0-SNAPSHOT.jar