Eclipse plugin putting .pom files as classpath entries

Gradle Eclipse plugin, when processing a dependency which doesn’t have a .jar will put the .pom into the classpath, breaking Eclipse compilation. For instance, I’ve tried to include

testCompile 'org.jboss.arquillian.graphene:arquillian-graphene:+'

which gives me the following erroneous classpath entries: arquillian-drone-webdriver-depchain…pom graphene-selenium…pom graphene-webdriver…pom

When Eclipse tries to compile, the result is a series of errors including “Files cannot be linked to folders”, “link path” errors, and “invalid jar” errors. Removing those entries manually from the classpath resolves the issue.

The issue here really seems to be that, since there’s no .jar, the default artifact downloaded is the .pom file, which clearly isn’t an artifact, and attempts to place it on the classpath. That doesn’t do any particular harm for compiling, but it does in other contexts. What it needs is something like the opposite of 44.4.1.2. Artifact only notation, a way to exclude the artifact but still get the transient dependencies.

It might be a bug, I’ll push this to jira.

For the time being, you can work around by excluding offending artifacts at the dependency level or using the IDE dsl (http://gradle.org/docs/current/dsl/org.gradle.plugins.ide.eclipse.model.EclipseClasspath.html).

Hope that helps!