spring-boot-maven-plugin 插件
2024-09-27 03:47:48
添加了spring-boot-maven-plugin插件后,当运行maven打包的命令,项目会被打包成一个可以直接运行的jar包,使用"java -jar"可以直接运行。
当项目中有两个启动类时,需要制定要执行的类,如果不指定,启动会报错。
指定启动类有两种情况需要区分
一:pom文件继承自spring-boot-starter-parent
<properties>
<start-class>com.xx.xx</start-class>
</properties>
二:pom文件不是继承自spring-boot-starter-parent
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>2.0.5.RELEASE</version> <configuration> <mainClass>com.xx.xx</mainClass> </configuration> <executions> <execution> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> </plugins> </build>
最新文章
- [JS,Canvas]日历时钟
- XML基础
- 使用centos引导内核错误:kernel: pnp 00:0b: can&#39;t evaluate _CRS: 8
- 自制Unity小游戏TankHero-2D(4)关卡+小地图图标+碰撞条件分析
- yII中利用urlManager将URL改写成restful风格 这里主要涉及url显示样式
- maven3创建多模块web项目
- WIN7 64位系统注册银行支付组件
- SELECT时为何要加WITH(NOLOCK)
- MVC中modelstate的使用
- HDU5742:It&#39;s All In The Mind(模拟+贪心 )
- LG 2.2.1 P350安卓系统刷机,问题总结,希望对需要的朋友有助
- 主题简介 ASP .NET
- They Are Everywhere
- Mac--Homebrew简介及安装
- IIS配置页面重写(配合插件url-rewrite2去除页面后缀名)
- HDU 5446
- SASS 简单实用
- Python3 sqlacodegen 根据已有数据库生成 ORM 使用的 model.py
- 【VUE】@click加上v-bind绑定切换类名及动画事件
- 使用xmlHttprequest有感
热门文章
- 最后一个 last-of-type
- “全栈2019”Java第五十八章:多态中方法返回类型可以是子类类型
- java集合类学习笔记之LinkedHashMap
- css第二篇:样式的特殊性、重要性、继承和层叠
- python正则表达式记录
- 【Python】Excel数据处理
- int和double究竟占多少个字节?c++等
- python入门练习之如何连接数据库
- Python - 购物车代码 (账户登陆,用户个人清单存取,重要信息高亮显示)
- 3dsmax2013卸载/安装失败/如何彻底卸载清除干净3dsmax2013注册表和文件的方法