1

I am getting the following error on Jenkins when I try to do a gradle build of my code along with Junit tests:

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

Basically Jenkins is trying to look for the directory specified in the logback.xml, but it doesn't have permission to build the directory structure.

I am using the Jacoco plugin with Jenkins for generating test reports.

Any help to resolve this issue is very much appreciated.

Thanks

bto
  • 1,399
  • 11
  • 19
Ajay C.V.
  • 13
  • 3

1 Answers1

0

I resolved the issue by using @TestPropertySource(properties = "logging.config=classpath:logback.xml") where in the logback-spring.xml was ignored during Jenkins build.

Ajay C.V.
  • 13
  • 3
  • Feel free to accept own answer if it helped, so others can see this problem was solved. – Piro says Reinstate Monica Aug 22 '18 at 08:20
  • If we give this line @TestPropertySource(properties = "logging.config=classpath:logback.xml") in test classes, do we have to create a separate logback.xml? I have only logback-spring.xml in classpath. – das May 27 '20 at 10:18