spring-boot-dependencies jar 不完整的问题
集成 springboot 有两种方式。
1 直接 父项目指向 springboot
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.3.RELEASE</version>
</parent>
这种用起来很方便 ,默认打出的jar 也是完整的。
2 使用 spring-boot-dependencie
<!-- springcloud -->
<dependencyManagement>
<dependencies> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.0.3.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
这种默认打出的jar包是不完整的。 不能直接运行。
加入下面的配置就可以了
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.sbl.pay.subaccount.SubaccountServerRunner</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
第二种麻烦一点,但是我们可以使用自己的父类。
spring-boot-dependencies jar 不完整的问题的更多相关文章
- Spring boot 打成jar包问题总结
Spring boot 打成jar包问题总结 1.Unable to find a single main class from the following candidates 1.1.问题描述 m ...
- spring boot将jar包转换成war包发布
spring boot将jar包转换成war包发布步骤 将<packaging>jar</packaging>修改为<packaging>war</packa ...
- Spring Boot Executable jar/war 原理
spring boot executable jar/war spring boot里其实不仅可以直接以 java -jar demo.jar的方式启动,还可以把jar/war变为一个可以执行的脚本来 ...
- Spring Boot由jar包转成war包
Spring Boot由jar包转成war包 spring boot 默认是以jar包形式启动web程序,在新建spring boot项目时候可以选择war包的启动方式. 建议在开发的时候建立以jar ...
- Spring Boot 发布 jar 包转为 war 包秘籍。
Spring Boot是支持发布jar包和war的,但它推荐的是使用jar形式发布.使用jar包比较方便,但如果是频繁修改更新的项目,需要打补丁包,那这么大的jar包上传都是问题.所以,jar包不一定 ...
- Spring Boot 配置 jar 包外面的 Properties 配置文件
一.概述 Properties 文件是我们可以用来存储项目特定信息的常用方法.理想情况下,我们应该将其保留在 jar 包之外,以便能够根据需要对配置进行更改. 在这个教程中,我们将研究在 Spring ...
- Spring Boot 以 jar 包方式运行在后台
spring-boot jar 包方式启动: 首先,为了防止和常用的 Tomcat 8080 端口冲突,将 Spring-boot 项目的端口号设置为 9090. 具体方法:在 application ...
- Spring Boot导出jar包发布
一:事由 现在的项目组开发项目使用的是Spring Boot的技术,开发的时候是直接通过一个入口主函数来启动项目的.如果将项目交给客户,怎样才能正确的发布运行呢?百度了一下有关的知识,大概了解到是通过 ...
- spring boot 打jar包,获取resource路径下的文件
前言:最近在spring boot项目静态类中获取resource路径下文件,在idea中启动都可以获取,但是打包后变成了jar包 就无法获取到. 我想到了两种方法,一种是根据http访问静态资源比如 ...
- Windows系统配置.bat启动spring boot项目jar
背景:项目用spring boot构建,maven管理,本地测试好之后打成jar包,在dos窗口可以通过:java -jar demo.jar来启动demo项目,一旦关闭该dos窗口demo项目也被停 ...
随机推荐
- postman工具测试接口
本篇文章主要介绍怎么在postman工具中进行接口的测试? 从以下几个方面进行介绍: 1.先介绍下接口测试 2.不同类型的接口请求方式如何在postman中进行测试 1.1 接口 什么是接口? 接口一 ...
- zepto和jquery关于获取css样式的试用差别
例如 获取 html标签的 字体大小, zepto中方法:$("html").css( "font-size" ); jquery中方法:$("htm ...
- L306 词汇题
Public acceptance of rabbit as an economical source of protein depends on how aggressively producers ...
- Homebrew&Mongod
Homebrew官网:http://brew.sh Homebrew installs the stuff you need that Apple didn't Homebrew的安装非常简单,打开终 ...
- react native 之 事件监听 和 回调函数
同原生一样,react native 同样也有事件监听和回调函数这玩意. 场景很多,比如:A界面push到B界面,B界面再pop回A界面,可以给A界面传值或者告诉A刷新界面. 事件监听 事件监听类似于 ...
- Notepad++同一窗口显示左右显示两份文档
Notepad++同一窗口显示左右显示两份文档 直接打开一份文档,test1.txt 再打开第二份文档,test2.txt,会显示成这样: 两份文档是以标签的形式展示的,有时需要同时查看两份文档, ...
- nginx php
server { listen 443; server_name www.awkj.com; ssl on; ssl_certificate cert/214683879970617.pem; ssl ...
- Windows在当前目录打开cmd
/********************************************************************** * Windows在当前目录打开cmd * 说明: * ...
- WEBBASE篇: 第三篇, CSS知识1
第三篇, CSS知识1 一,CSS 介绍 CSS: Cascading Style Sheets ---样式表 HTML: 搭建网页结构: CSS: 在网页结构基础上进行网页的美化: 二,CSS的使用 ...
- MySQL篇,第四章:数据库知识4
MySQL 数据库 4 数据备份(在Linux终端操作) 1.命令格式 mysqldump -u用户名 -p 源库名 > 路径/XXX.sql 2.源库名的表示方式 --all-database ...