springboot maven
更多信息请从官网获取https://docs.spring.io/spring-boot/docs/2.0.1.RELEASE
1.parent基于自己项目而非spring-boot-starter-parent
目前解决方案
(1)所有的springboot依赖显示写出版本号
(2)plugin显示写出执行目标repackage
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>2.0.1.RELEASE</version>
</dependency> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.0.1.RELEASE</version>
</dependency> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>2.0.1.RELEASE</version>
<scope>test</scope>
</dependency> <plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.0.1.RELEASE</version>
<configuration>
<classifier>exec</classifier>
<executable>true</executable>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
note: <classifier>exec</classifier>该标签作用是如果有其他项目依赖该项目时,会打成两个jar,一个是xxx.jar(别的项目依赖用)另一个是xxx-exec.jar(部署执行用)
2.idea run没问题,打成jar包执行报资源文件找不到
目前解决方案是拷贝一份资源文件到classes目录下即可
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration> </execution>
</executions>
</plugin>
如果idea run也报资源文件找不到
(1)检查该文件是否存在resources文件夹内
(2)检查resources文件夹是否为Resources Root 。否则右键Mark Directory As --> Resources Root 即可
springboot maven的更多相关文章
- springboot+maven整合spring security
springboot+maven整合spring security已经做了两次了,然而还是不太熟悉,这里针对后台简单记录一下需要做哪些事情,具体的步骤怎么操作网上都有,不再赘述.1.pom.xml中添 ...
- springboot maven项目,为什么build成功,build path也没错误,project-->clean 也没用,项目上面还是有个红x呢?
springboot maven项目,为什么build成功,build path也没错误,project-->clean 也没用,项目上面还是有个红x呢? 看错误信息有提示: Descript ...
- SpringBoot+Maven 多模块项目的构建、运行、打包
SpringBoot+Maven 多模块项目的构建.运行.打包 https://blog.csdn.net/zekeTao/article/details/79413919
- java springboot+maven发送邮件
springboot+maven发送邮件 废话不多说直接上代码 1. pom 文件导入jar包 <!--邮件发送--> <dependency> <groupId> ...
- 工具IDEA 配置springboot+maven项目
工具IDEA 配置springboot+maven项目 首先安装IDEA,至于怎么安装就不介绍了.. 第一步 配置maven环境 首先安装maven,先在网上下载一个maven包.在IDEA的sett ...
- springboot+maven——打war包方式
转载 Springboot打包war包部署到自己的tomcat中 一.springboot+maven工程——打war包步骤如下: 1.修改父pom.xml文件: <packaging>p ...
- 转 使用Docker部署 spring-boot maven应用
转自:https://blog.csdn.net/u011699931/article/details/70226504/ 使用Docker部署 spring-boot maven应用 部署过程分为以 ...
- IDEA + SpringBoot + maven 项目文件说明
Springboot + maven + IDEA + git 项目文件介绍 1..gitignore 分布式版本控制系统git的配置文件,意思为忽略提交 在 .gitingore 文件中,遵循相应 ...
- springboot maven打包插件
<build> <plugins> <!-- springboot maven打包--> <plugin> <groupId>org.spr ...
- springboot maven项目运行常见报错 及ajax请求报错
如图所示 tomcat运行后直接停止,也不报错 原因:我的原因是controller路径配置重名或者service没有配置@Service 遇见这错找了好久问题,网上也搜不到,特此记录一下 问题2 a ...
随机推荐
- Disruptor时序调用
接下来,我会对disruptor的设计和源码上进行讲解,先来一篇时序图,简单理解下disruptor的工作过程
- PHP中的call_user_func()与call_user_func_array()简单理解
原文地址:http://small.aiweimeng.top/index.php/archives/52.html call_user_func:把一个参数作为回调函数调用 用法说明: call_u ...
- GATK --- wdl 语言
GATK的pipeline使用WDL进行编写 WDL是一种流程管理语言,内置的支持并行,适合编写pipeline 运行wdl脚本需要两步:第一步编辑参数列表对应的json文件,第二步直接运行Cromw ...
- 时间序列深度学习:状态 LSTM 模型预测太阳黑子
目录 时间序列深度学习:状态 LSTM 模型预测太阳黑子 教程概览 商业应用 长短期记忆(LSTM)模型 太阳黑子数据集 构建 LSTM 模型预测太阳黑子 1 若干相关包 2 数据 3 探索性数据分析 ...
- 20155235 《网络攻防》 实验一 逆向及Bof基础实践说明
20155235 <网络攻防> 实验一 逆向及Bof基础实践说明 实验目的 本次实践的对象是一个名为pwn1的linux可执行文件. 该程序正常执行流程是:main调用foo函数,foo函 ...
- WPF字体模糊解决方案
原文:WPF字体模糊解决方案 WPF对字体渲染做了很大的改善,与Winform窗体字体相比较,更加平滑,但是当字体大小较小时,则会出现字体模糊的现象.可通过以下方法进行改善处理: 对于XAML用户界面 ...
- WPF 学习笔记-在WPF下创建托盘图标
原文:WPF 学习笔记-在WPF下创建托盘图标 首先需要在项目中引用System.Windows.Forms,System.Drawing; using System; using System.Co ...
- Linux下nginx编译安装教程和编译参数详解
这篇文章主要介绍了Linux下nginx编译安装教程和编译参数详解,需要的朋友可以参考下 一.必要软件准备1.安装pcre 为了支持rewrite功能,我们需要安装pcre 复制代码代码如下: # y ...
- HT7A6312—— 离线开关电源小功率初级转换开关IC 记录总结
1. 芯片特性 a. 固定60KHz开关频率: b. 宽Vcc输出电压范围:9V - 38V: c. 宽交流输入电压范围:85Vac - 265Vac: d. 电流模式PWM控制: e. 带迟滞的辅助 ...
- CentOS安装GoAccess
官网 https://goaccess.io/ yum -y install glib2 glib2-devel ncurses ncurses-devel GeoIP GeoIP-devel安装依赖 ...