[GRADLE-1152] eclipse plugin creates incorrect .classpath for Scala project Created: 16/Sep/10  Updated: 04/Jan/13  Resolved: 22/Feb/11

Status: Resolved
Project: Gradle
Affects Version/s: 0.9
Fix Version/s: 1.0-milestone-1

Type: Bug
Reporter: Jeppe Nejsum Madsen Assignee: Peter Niederwieser
Resolution: Not A Bug Votes: 0


In order to generate an Eclipse .classpath that works with the latest Scala IDE for Eclipse, I had to add the following to my build.gradle:

The Eclipse plugin should do this automatically if used with the Scala plugin.

Comment by Jeppe Nejsum Madsen [ 16/Sep/10 ]

Hmm, Jira thought this should be saved when pasting stuff in the field and I can't edit the ticket. Here's what I put in build.gradle:

eclipseClasspath.containers += ["org.scala-ide.sdt.launching.SCALA_CONTAINER"]
eclipseClasspath.minusConfigurations = [configurations.scalaTools]

Comment by Peter Niederwieser [ 24/Jan/11 ]

What problems where you having exactly? I just tried with Eclipse 3.5.2 and the latest Scala plugin for Scala 2.8.1. Simple demo project created with Gradle 0.9.2 builds and runs fine in Eclipse.

It is true that when generating a Scala project in Eclipse, a Scala container is added. I'm unsure if Gradle should do the same thing. On one hand, it would guarantee that the Scala version used by Eclipse is compatible with the installed Scala plugin. On the other hand, it would give up all control over which Scala version is used by Eclipse (vs. Gradle). Any opinions?

Comment by Jeppe Nejsum Madsen [ 04/Feb/11 ]

Just verified with Eclipse 3.6.1 and wip_backport branch of the Scala Ide Plugin and yes, you are correct, it does work now.

I tend to agree with you that it is better to control the scala version from the gradle side, since all the remaining deps are specified here. Otoh, when creating a java project, it will use the Java compiler from Eclipse, not javac as used by Gradle?

Don't know if this will bring trouble down the road where the ide may use a newer presentation compiler etc. But then you at least have the option (by using the above example) to switch

Comment by Peter Niederwieser [ 22/Feb/11 ]

I'm closing this issue because the .classpath file generated for Scala projects seems to work fine. In case you find new evidence that adding a Scala container would be more appropriate, please create a new issue.

Generated at Wed Jun 30 11:48:16 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.