I wanted to upgrade from Gradle 5.5 to the latest 5.6.2 and start getting an error in Eclipse (using the latest version of Buildship):
eclipse.buildId=4.12.0.I20190605-1800
java.version=11.0.3
org.eclipse.jdt.core
Error
Test source folder 'src/test/java' in project 'project' must have a separate output folder
Preparing example project I’ve understood what was the reason of the problem. I tried to preserve the same output folder for all sources:
eclipse.classpath {
defaultOutputDir = file('classes')
file.whenMerged {
entries.each {
// Use default output for all source folders
if (it instanceof SourceFolder) it.output = null
}
}
}
I am just wondering whether is it possible to use the same approach with the 5.6 version? I don’t want to have several output folders for main and test classes.
The output separation is necessary for using Eclipse’s test sources feature. If you don’t need that, simply delete the test=true classpath attribute from all classpath entries in the file.whenMerged block. Then, you’ll be able to use the same output location for all source folders.