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 ...
随机推荐
- 17、xtrabackup 常用备份功能与选项
并行备份 > innobackupex -p123123 --parallel=8 /backup 节流备份 > innobackupex -p123123 --throttle=200 ...
- css3里面的-webkit-transition
css3里面的-webkit-transition (1)-webkit-transition-timing-function 可以定义动画的变化时间曲线-webkit-transition-timi ...
- 【智能算法】粒子群算法(Particle Swarm Optimization)超详细解析+入门代码实例讲解
喜欢的话可以扫码关注我们的公众号哦,更多精彩尽在微信公众号[程序猿声] 01 算法起源 粒子群优化算法(PSO)是一种进化计算技术(evolutionary computation),1995 年由E ...
- POJ3321 Apple Tree (JAVA)
树形数组题,有一定难度. 首先得搞清楚树形数组是什么 - 它是建立在原始数组上的统计数组 - 目的:方便对原始数组进行切片统计,主要用于统计切片的累加和 其实你可以对切片进行扫描,把元素一个一个加起来 ...
- golang (3) 编译不同的平台文件
Golang 支持在一个平台下生成另一个平台可执行程序的交叉编译功能. Mac下编译Linux, Windows平台的64位可执行程序: CGO_ENABLED=0 GOOS=linux GOARCH ...
- 初级算法49题 — LeetCode(20181122 - )
Array: Single Number class Solution { public int singleNumber(int[] nums) { if (nums == null || nums ...
- Python——模块以及导入注意事项
在Python中,每一个文件都应该是可以被导入的. 每一个独立的python文件都是一个模块 在导入文件时,文件中所有没有任何缩进的代码都会被执行一遍. 而在实际应用时,每个模块都是有专人负责独立开发 ...
- SQL chema的新增和修改
1.先要创建你自己的schema create schema myschema 2. alter schema myschema transfer ado.User --执行完后,User表就 ...
- php中die(),exit(),return的区别
die()停止程序运行,输出内容exit是停止程序运行,不输出内容return是返回值die是遇到错误才停止exit是直接停止,并且不运行后续代码,exit()可以显示内容.return就是纯粹的返回 ...
- Linux下与Windows下开发软件
Linux下开发程序可以完全发挥自己的聪明才智,因为系统内核是完全开放的.Windows下开发程序就稍微郁闷一点,不论何种语言都必须在调用系统API的基础上开发,因为系统内核是不开放的. 这两种系统正 ...