当我尝试与Junit测试一起进行代码的gradle构建时,我在Jenkins上收到以下错误:
Caused by: java.lang.IllegalStateException: java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - Failed to create parent directories for xxxxxx
基本上Jenkins试图查找logback.xml
中指定的目录,但它没有构建目录结构的权限。
我正在使用Jenkins的Jacoco插件生成测试报告。
非常感谢您解决此问题的任何帮助。
谢谢
我通过使用@TestPropertySource(properties =“logging.config = classpath:logback.xml”)解决了这个问题,其中在Jenkins构建期间忽略了logback-spring.xml。