It seems that the Eclipse project created for scala projects has a special container for the scala-library, however, it is not the version specified in the dependencies, but rather whatever is shipped with Scala IDE.
That seems silly, what if I want to use a newer point release (for example, right now Scala IDE is at 2.10.2 but 2.10.3 is available)
That’s how Scala IDE works. The Gradle Eclipse plugin specifically doesn’t add its own Scala version because it would lead to conflicts.
I have the same concern. I have specified which version of Scala I want to use as a dependency in gradle, and yet I have to manually reconfigure ScalaIDE to use the desired “Scala Library Container” for each generated eclipse project, because the “gradle eclipse” task does not configure the right scala library. This is something the whole development team will have to repeat, and introduces the potential for user error, so it would be great if it could be automated (fixed).
Peter, I am not convinced (yet) that there is nothing Gradle can do to fix this behavior. I have found that after generating the Eclipse project using “gradle eclipse”, I can manually remove the reference to the “Scala Library Container”, and add a reference to a “scala-library.jar”. ScalaIDE seems perfectly happy to use this scala-library.jar, so it seems the container is not a hard requirement.
I already have “scala-library.jar” as one of the dependencies declared in gradle. Unfortunately, “gradle eclipse” suppresses this dependency (it does not add it to the Eclipse .classpath), and instead adds a “Scala Library Container” entry. If “scala-library.jar” is already included in the dependencies, could “gradle eclipse” instead: (1) include this jar in the classpath, and (2) suppress the “Scala Library Container” entry?
P.S. If you are reticent to change the existing behavior of “gradle eclipse”, perhaps the proposed new behavior could be a configurable option which could be specified in the build script.