I'm using IntelliJ together with maven. I want to create an external configuration folder (i.e. not included in the jar) containing things like logback.groovy
and some property files. This folder is added to the classpath by maven (via the maven-jar-plugin, see Maven - how can I add an arbitrary classpath entry to a jar? ). But if I run the project from inside IntelliJ, this classpath entry is not added and the contents in the corresponding folder is not found. Adding the folder as runtime-module-dependency fixes the problem but does not seem very clean. Is there any way I can configure maven such that classpath entries are added to the IntelliJ run too. If thats not possible, can I somehow add a classpath entry to the execution without resorting to dependencies etc.? In eclipse I could add arbitrary classpath entries to the run configuration, I'm sure I'm just missing some menu in IntelliJ.
Note that marking the folder as resource (in either maven or IntelliJ) is not an option, as the folder contents then get copied to target/classes
and bundled into the jar.
EDIT: Rationale for why a separate folder: External libraries (like for example logback) load their dependencies directly from the classpath without much possibilities of intervention (as far as I understood it). I highly dislike putting loads of configuration files all over the place and instead want them to be as centralized as possible.
Follow-Up question: Am I misusing the concept of classpath here?