classpath.plusConfigurations defaults

(Aaron Madlon-Kay) #1

I am using Buildship 1.0.20, Gradle 3.1, and Eclipse 4.6.

I noticed that my runtime dependencies are not being used in Eclipse when doing “run as Java application”. Instead it appears to only use the testCompile / testRuntime dependencies.

Here is what I get when I print eclipse.classpath.plusConfigurations:

[configuration ':testRuntime', configuration ':compileClasspath', configuration ':testCompileClasspath']

I get the same result from a new project created with gradle init --type java-library, so this does not appear to be specific to my project.

In the Buildship FAQ it says that plusConfigurations by default includes compileOnly, runtime, testCompileOnly and testRuntime. This appears to be inconsistent with the actual values.

Which one is correct?

(Donát Csikós) #2

They are equal. If you check the hierarchy of configurations from the Java plugin, you can see that the three configuration you listed cover all configurations from the FAQ.

(Aaron Madlon-Kay) #3

That is only true if you are not doing explicit exclusions. For instance we are excluding some runtime dependencies from testRuntime because they are not used in tests; such dependencies are not reflected in the Eclipse classpath despite the claim in the FAQ that runtime is specifically included.

(Stefan Oehme) #4

@amake could you open an enhancement request for that?

(Aaron Madlon-Kay) #5

Thanks. Done: