Problem upgrading to gradle version 5.6

Dear guru,

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):

Test source folder 'src/test/java' in project 'project' must have a separate output folder

Could you please advice how to proceed with that?


Can you please create a minimal example project showing the problem?

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.