Jenkins构建失败,因为它正在查找执行junit测试时在logback.xml中定义的日志路径

问题描述 投票:1回答:1

当我尝试与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插件生成测试报告。

非常感谢您解决此问题的任何帮助。

谢谢

jenkins junit4 logback
1个回答
0
投票

我通过使用@TestPropertySource(properties =“logging.config = classpath:logback.xml”)解决了这个问题,其中在Jenkins构建期间忽略了logback-spring.xml。

© www.soinside.com 2019 - 2024. All rights reserved.