添加了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>

最新文章

  1. [JS,Canvas]日历时钟
  2. XML基础
  3. 使用centos引导内核错误:kernel: pnp 00:0b: can&#39;t evaluate _CRS: 8
  4. 自制Unity小游戏TankHero-2D(4)关卡+小地图图标+碰撞条件分析
  5. yII中利用urlManager将URL改写成restful风格 这里主要涉及url显示样式
  6. maven3创建多模块web项目
  7. WIN7 64位系统注册银行支付组件
  8. SELECT时为何要加WITH(NOLOCK)
  9. MVC中modelstate的使用
  10. HDU5742:It&#39;s All In The Mind(模拟+贪心 )
  11. LG 2.2.1 P350安卓系统刷机,问题总结,希望对需要的朋友有助
  12. 主题简介 ASP .NET
  13. They Are Everywhere
  14. Mac--Homebrew简介及安装
  15. IIS配置页面重写(配合插件url-rewrite2去除页面后缀名)
  16. HDU 5446
  17. SASS 简单实用
  18. Python3 sqlacodegen 根据已有数据库生成 ORM 使用的 model.py
  19. 【VUE】@click加上v-bind绑定切换类名及动画事件
  20. 使用xmlHttprequest有感

热门文章

  1. 最后一个 last-of-type
  2. “全栈2019”Java第五十八章:多态中方法返回类型可以是子类类型
  3. java集合类学习笔记之LinkedHashMap
  4. css第二篇:样式的特殊性、重要性、继承和层叠
  5. python正则表达式记录
  6. 【Python】Excel数据处理
  7. int和double究竟占多少个字节?c++等
  8. python入门练习之如何连接数据库
  9. Python - 购物车代码 (账户登陆,用户个人清单存取,重要信息高亮显示)
  10. 3dsmax2013卸载/安装失败/如何彻底卸载清除干净3dsmax2013注册表和文件的方法