class path resource [logback.xml] cannot be resolved to URL because it does not exist 问题解决
今天在自己搭建Springboot 框架的时候,在配置 logging.config=classpath:logback.xml 出现找不到这个文件的错误
经发现是maven的一个写法问题,本来我是打算打算替换 .properties文件中的内容,后面启动的时候报错,发现主要原因是
mavne 默认的resource会把src/main/resources中资源文件全部放在claaapath目录下,可是我自己重新定义已resource,只把./properties 文件放入,所有导致找不到loback.xml文件
<build>
<resources>
<resource>
<targetPath>${project.build.directory}/classes</targetPath>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
</build>
正确的写法如下:
<build>
<resources>
<resource>
<targetPath>${project.build.directory}/classes</targetPath>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/*.properties</include>
<include>**/logback.xml</include>
</includes>
</resource>
</resources>
</build>
写好以后,记得更新下maven,要不然有时候因为缓存问题,而失效
class path resource [logback.xml] cannot be resolved to URL because it does not exist 问题解决的更多相关文章
- Could not resolve resource location pattern [classpath:com/****/mappers/*.xml]: class path resource [com/****/mappers/] cannot be resolved to URL because it does not exist的问题
这里建议先去看看路径的问题,看看application.xml的里面的导入的相应的配置文件的路径有没有问题,如下: 再者看看相应的注解有没有加上,service和controller等的注解 如果再不 ...
- maven项目启动报错;class path resource [com/ssm/mapping/] cannot be resolved to URL because it does not exist
项目启动报了一堆错误,其实都是class path resource [com/ssm/mapping/] cannot be resolved to URL because it does not ...
- spring 编译时抱错纪录class path resource [spring/] cannot be resolved to URL because it does not exist
class path resource [spring/] cannot be resolved to URL because it does not exist; 在 pom.xml 里添加如下代码 ...
- class path resource [processes/] cannot be resolved to URL because it does not exist
springboot整合activiti时报以下错误,原因是项目启动时检查流程文件 nested exception is java.io.FileNotFoundException: class p ...
- Maven项目启动失败:class path resource [spring/] cannot be resolved to URL because it does not exist
目录 Maven项目启动失败:class path resource [spring/] cannot be resolved to URL because it does not exist 解决方 ...
- Caused by: java.io.FileNotFoundException: class path resource [com/cxy/springboot/mapping/] cannot be resolved to URL because it does not exist
java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.conte ...
- 项目中运行报错: Loading XML bean definitions from class path resource [applicationContext.xml]
记录一下: org.springframework.context.support.AbstractApplicationContext prepareRefresh Refreshing org.s ...
- Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; neste
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFacto ...
- Caused by: java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be ope
1.错误描述 java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.tes ...
随机推荐
- 树莓派 Raspbian
备注,从右往左分别是:无线鼠标一个, HDMI转VGA接口一个,网线一根,小米充电宝电源线一个.树莓派Pi 3 一台,包括读卡器一个+32G class10 SD卡一块.最后俩个U盘作为备用里面有Ar ...
- 用JS实现汉字转拼音
<!DOCTYPE HTML> <html> <head> <title>用JS实现汉字转拼音</title> <meta chars ...
- js,timeout,promise执行顺序
总结 macro-task包括:script(整体代码), setTimeout, setInterval, setImmediate, I/O, UI rendering. micro-task包括 ...
- POJ3666 Making the Grade
POJ3666 Making the Grade 题意: 给定一个长度为n的序列A,构造一个长度为n的序列B,满足b非严格单调,并且最小化S=∑i=1N |Ai-Bi|,求出这个最小值S,1<= ...
- [转载]Flip an image in UIImageView using UIView transitionWithView
View animations on the iPhone are wonderful. Used properly they will delight your users and help you ...
- weex 编译vue成js
cd 项目 1.开发 npm run web 开发过程中可以直接使用浏览器运行 npm run ios 2.打包 npm run build 会在 dist 文件夹 中生成js文件, 即可拖入ios ...
- ubuntu 16.04 安装opencv 2.4.13
ubuntu 16.04 安装opencv 2.4.13 https://blog.csdn.net/u011557212/article/details/54706966?utm_source=it ...
- Vue页面加载时,触发某个函数的方法
需要在加载页面的时候调用生成验证码的click事件函数 解决方法如下,利用Vue中的mounted mounted:function(){ this.createcode();//需要触发的函数 } ...
- django中使用时间帅选报RuntimeWarning: DateTimeField Coupon.valid_begin_date received a naive datetime (2018-08-16 20:51:40.135425) while time zone support is active.
今天在使用当前时间进行筛选数据时出现了RuntimeWarning: DateTimeField Coupon.valid_begin_date received a naive datetime ( ...
- NOI Linux学习
打开终端: cd (目录名)//进入该目录的终端 cd ..//退出该目录,返回上一层. 修改用户名 密码: 修改密码: passwd//直接修改root密码 passwd (用户名)//修改该用户的 ...