Directories not getting added to IDEA classpath with idea plugin

I have this code in one of my .gradle files: sourceSets.main.runtimeClasspath += files("$aeConfDir/Caching") + files("$aeConfDir/glue/maps") sourceSets.test.runtimeClasspath += files("$aeConfDir/Caching") + files("$aeConfDir/glue/maps")

When I go into IDEA, these directories are not configured as in the classpath of the IDEA project.

How do I get this?

thanks

The IDEA plugin uses what’s on the compile/runtime/testCompile/testRuntime configuration, not what’s on the source sets’ class paths. So either you add your directories to the ‘runtime’ configuration, or you add them to separate configurations and add those to ‘idea.module.scopes.RUNTIME.plus’. See the DSL reference for ‘IdeaModule’ for details.

How do I add a directory directly to the runtime configuration? All the examples I can find go thru the sourceSets…

dependencies {
    runtime files("/path/to/dir")
}

Documented in the DSL reference.

I get this error when I try that:

What went wrong: A problem occurred evaluating project ‘:modules:bam-ae’. > Could not find method runtime() for arguments [file collection] on project ‘:modules:bam-ae’.

did you mean to put it in “dependencies” not “configurations”?

Yes.

Thanks! Works!