Java – Specifying logback.xml in Java Maven project

javalogbackmaven

I have a Java maven project where I need to use logback as the logging framework. I have placed the logback.xml configuration file in the src/main/conf folder. However, it looks like it is not getting picked up because src/main/conf is not in the class path. On building the project I copy all the contents of that folder to target/root/conf and wanted to have that directory as part of my classpath. Can anyone let me know how can I force that?

Best Answer

In a Maven project the default directory for resource file is src/main/resources. This is the layout directory, if you still want to change this default, follow these instructions.