今天在自己搭建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. 选项卡tab2

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  2. “全栈2019”Java第五十八章:多态中方法返回类型可以是子类类型

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

  3. 【转】ListBox Dock Fill 总是有空隙的问题

    源地址:https://www.cnblogs.com/norsd/p/6359291.html ListBox Dock设置了Fill, Right等 设计界面如己所愿,但是实际运行时,底部总是有不 ...

  4. redis删除指定前缀的缓存

    redis作为缓存服务器为MySQL数据库提供较高的防御性,对于一些数据的查询可以直接从缓存中可以进行查询. 但是,某些情况下,我们需要清除缓存. 以下场景: 公司经常做活动,每个活动都存在大量的数据 ...

  5. linux校验时间

      一. 基本方法:date -s "2018-09-02 04:23:45"clock -w 把时间写入cmos(一个RAM芯片) hwclock 查看硬件时间 hwclock ...

  6. P4175 [CTSC2008]网络管理 树剖+树套树

    $ \color{#0066ff}{ 题目描述 }$ M公司是一个非常庞大的跨国公司,在许多国家都设有它的下属分支机构或部门.为了让分布在世界各地的N个部门之间协同工作,公司搭建了一个连接整个公司的通 ...

  7. Source Insight 查看函数调用关系

    研究海思SAMPLE时,使用Source Insight查看源码,函数调用关系查看: 选中一个函数,右键选择"Show in Relation Window" 显示界面的相关设置: ...

  8. 1093 字符串A+B (20 分)

    #include <iostream> using namespace std; int main() { int n; string s1, s2; getline(cin,s1); g ...

  9. 三种实现日志过滤器的方式 (过滤器 (Filter)、拦截器(Interceptors)和切面(Aspect))

    1.建立RequestWrapper类 import com.g2.order.server.utils.HttpHelper; import java.io.BufferedReader; impo ...

  10. Vmtools的安装步骤

    目的:实现win和centos之间的相互复制功能 1.进入centos 2.点击vm菜单的->虚拟机->安装VMware Tools 3.centos会出现一个vm的安装包 4.将文件移动 ...