Gradle 3.2.1 breaks 'junit-test-suite' and 'java' interop


(Casper Færgemand) #1

I’m using the following plugins together: junit-test-suite, java and eclipse.

On switching to Gradle 3.2.1, building a projects fails with the vaguest error:

* What went wrong:
Exception thrown while executing model rule: TestingModelBasePlugin.Rules#attachBinariesCheckTasksToCheckLifecycle(Task, ModelMap)
> A dependency must not be empty

Enabling stacktraces and more logging doesn’t point at anything useful.

It turned out that having a dependencies block (for the java plugin) and using the junit-test-suite at the same time is the culprit. Removing the dependencies block fixes the error, as does removing the junit-test-suite and its testSuites block in model. In Gradle 3.1 the two plugins could coexist.

The only reason I use the java plugin is because eclipse does not play nice with java-lang: The projects generated are not Java projects, making the plugin pointless without also using java. I tried setting the project type to Java manually in build.gradle’s eclipse portion, but it was difficult to set the correct source folders.

Is the eclipse plugin too old or is the java-lang plugin too young? Does anyone have a workaround for either manually setting project type and source folders, or for manually setting whatever the eclipse plugin goes looking for when it generates projects?

Also, where are the sources for the plugins located?

(Casper Færgemand) #2

I fixed my problem without really fixing the coexistence. I added a Gradle task that swaps out the build.gradle in the main and subprojects. In one script I keep the java stuff and in the other I keep java-lang stuff. It’s not very elegant, but it works.

(Benjamin Muschko) #3

The issue has been fixed with 3.3-RC1.

(Casper Færgemand) #4

I didn’t notice the snappy response. It’s working in 3.3 on my end, thank you.