今天在自己搭建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 问题解决的更多相关文章

  1. 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等的注解 如果再不 ...

  2. 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 ...

  3. 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 里添加如下代码 ...

  4. class path resource [processes/] cannot be resolved to URL because it does not exist

    springboot整合activiti时报以下错误,原因是项目启动时检查流程文件 nested exception is java.io.FileNotFoundException: class p ...

  5. 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 解决方 ...

  6. 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 ...

  7. 项目中运行报错: Loading XML bean definitions from class path resource [applicationContext.xml]

    记录一下: org.springframework.context.support.AbstractApplicationContext prepareRefresh Refreshing org.s ...

  8. 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 ...

  9. 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 ...

随机推荐

  1. jquery鼠标经过水平180度翻转效果

    Html代码: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/htm ...

  2. “全栈2019”Java第三十七章:类与字段

    难度 初级 学习时间 10分钟 适合人群 零基础 开发语言 Java 开发环境 JDK v11 IntelliJ IDEA v2018.3 文章原文链接 "全栈2019"Java第 ...

  3. AtCoder Grand Contest 031题解

    题面 传送门 题解 比赛的之后做完\(AB\)就开始发呆了--简直菜的一笔啊-- \(A - Colorful\ Subsequence\) 如果第\(i\)个字母选,那么它前面任意一个别的字母的选择 ...

  4. ObjectARX二次开发创建自己的静态库,如同objectARX库一样

    objectARX二次开发的时候,经常会用到一些重复使用的类,如果类已经足够的好,那么我们可以编译成静态库,加快开发和编译的速度,提高工作效率. 环境vs2010+objectARX2012wizar ...

  5. tcp 建立连接的三次握手,以及关闭连接的4次挥手

    TCP连接的三次握手 第一次握手:客户端发送syn包(syn=j)到服务器,并进入SYN_SEND状态,等待服务器确认; (客户端问服务器:你爱我吗?) 第二次握手:服务器收到syn包,必须确认客户的 ...

  6. ubuntu14.04搭建ftp服务器

    一,搭建匿名FTP服务器 实现ftp匿名登录,上传,下载,重命名文件. 1. 首先安装vsftpd:sudo apt-get install vsftpd,装好之后,默认的ftp根目录是在 /srv/ ...

  7. python difflib详解

    difflib -帮助进行差异化比较 这个模块提供的类和方法用来进行差异化比较,它能够生成文本或者html格式的差异化比较结果,如果需要比较目录的不同,可以使用filecmp模块. class dif ...

  8. [redis] 数据特性简单实验

    位图 由bit位组成的数组,实际的底层数组类型是字符串,而字符串的本质是二进制大对象,所以将其视作位图,位图存储的是boolean指,一定程度上可以减少存储空间. -- 设置位图指定偏移量的比特位的值 ...

  9. c++11 enable_shared_from_this

    本质的原因:raw data和引用计数的管理块,可能是分开的 使用场景: 需要在对象中得到shared ptr,  错误的代码:直接构造新的shared_ptr<A>对象,两个shared ...

  10. 主流服务器虚拟化技术简单使用——KVM(二)

    通过Linux工具管理KVM 主流服务器虚拟化技术简单使用——KVM(一)部署了一台KVM主机,提到KVM可以通过命令行工具(virt-install.virsh)和GUI工具(virt-manage ...