当前位置:网站首页>no main manifest attribute / . There is no main manifest attribute in jar
no main manifest attribute / . There is no main manifest attribute in jar
2022-04-22 13:20:00 【Blood lotus pill】
problem
take springboot The project into jar package , And then java -jar Package name Report errors ,

The reason is that we can't find jar In bag main The class of the method , The main entry of the program cannot be found .
solve
Situation 1
Your project is inherited from spring-boot-starter-parent , In the of the micro service to be packaged pom.xml Add the following configuration :
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
Situation two
Your project does not inherit from spring-boot-starter-parent , But through < dependencyManagement > Tags introduced , You need to specify it manually main Location of the method , Add the following configuration :
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.5.6</version>
<configuration>
<mainClass>com.zxb.oss.OssApplication</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
版权声明
本文为[Blood lotus pill]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204221306309704.html
边栏推荐
猜你喜欢

Redis如何查看单个key所占用的内存大小

How to add pictures as program resources in C #

ROS机器人学习——麦克纳姆轮运动学解算

C custom button implementation source code

ROS Robot Learning -- TF coordinate transformation

Network configuration in NAT mode after VMware virtual machine cloning

生态 | 万里数据库与溢信科技完成兼容认证

算法---反转链表(Kotlin)

抖音快手卧榻之侧,黄光裕难以酣睡

Download and installation of redis
随机推荐
Network configuration in NAT mode after VMware virtual machine cloning
ROS2——手把手教你编写一个话题
Données du panel sur la productivité verte totale des facteurs du pfgt par province (2004 - 2018)
Communication principle of SPI protocol
ROS2——手把手教你编写一个服务
The sales volume is cut by half, and there is no blueprint for lantu
Panel data of green total factor productivity of gtfp in all provinces (2004-2018)
树莓派压缩备份
mysql数据库已经成功启动,可是show不是内部或外部命令,该如何解决呢?
Oplg: new generation cloud primary observable best practices
What happens when the weight of the model and loss or intermediate variable become Nan
中英文会计&金融情绪词典
Algorithm --- reverse linked list (kotlin)
HDU 2544 Dijkstra(模板)
Download and installation of redis
What kind of database products do we need
托宾Q数据-沪深A股上市公司(含行业名称、代码等指标)2003-2020
Chrome multi device bookmark synchronization scheme
数字孪生:如何撑起一个万亿市场的产业变革?
Wong Kwong Yu Kwai tiktok is unable to sleep soundly.