Multiple classpaths for JavaExec

Firstly, you should never initialise task inputs in a doFirst{...} block. This closure is invoked in Gradle’s execution phase, task inputs should be configured in the configuration phase. See build phases

Secondly you should be able to use FileCollection.plus(FileCollection). Eg:

classpath = configurations.scalaRepl.plus(sourceSets.main.runtimeClasspath)
1 Like