Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Libraries marked as "provided' don't get their sources linked #154

DaGenix opened this Issue · 6 comments

6 participants


Sbteclipse doesn't seem to handle dependencies used with the "provided" configuration correctly when using with-sources=true. These dependencies will correctly be included in the generated eclipse project, however, their source code will not be linked to the library in the Eclipse project. "compile" and (probably) "test" dependencies work fine. However, it looks like any other type of dependency won't.

I think that the problem is in the "externalDependencies()" method in sbteclipse-core/src/main/scala/com/typesafe/sbteclipse/core/Eclipse.scala. This function is called twice - once for the "compile" configuration and once for the "test" configuration. Libraries defined in those configurations have their sources linked fine (well, I didn't try the "test" configuration, but, I suspect it works). I'm guessing that the problem is either that this function should be called for more configurations or that they way its looking up the source dependencies isn't quite correct since its trying to look them up in the "compile" or "test" configuration, but the sources aren't available in those configurations (I guess that could also be a bug in core sbt or ivy, although, I don't know sbt internals well enough to know if it is).

A sample project that demonstrates this issue:


Yes. So are the "provided" project dependencies.


Have you tried to add Provided to the configurations setting? See the Wiki:


I did try this one with sbteclipse 2.5.0 like this in build.sbt:

EclipseKeys.configurations := Set(Compile, Test, Provided)

and the following result:

[error] Could not create Eclipse project files:
[error] Undefined setting 'unmanagedSourceDirectories'!
[error] Undefined setting 'classDirectory'!
[error] Undefined task 'externalDependencyClasspath' for 'spark_test_project'!

is there any update on this bug? I'm also facing the problem of having provided source dependences not attached to Eclipse classpath. If I set EclipseKeys.configurations := Set(Compile, Test, Provided) to my buid.sbt I get the same error that elyast mentioned above. I'm using sbteclipse 3.0.0


@estebandonato Similar story for 4.0.0-RC2

[error] Could not create Eclipse project files:
[error] Undefined setting 'unmanagedSourceDirectories'!
[error] Undefined setting 'unmanagedResourceDirectories'!
[error] Undefined setting 'managedSourceDirectories'!
[error] Undefined setting 'managedResourceDirectories'!
[error] Undefined task 'externalDependencyClasspath' for 'xxx'!

I also get this error, and not with provided but when using IntegrationTest configuration in a global way when some specific SBT projects I have don't use IntegrationTest config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.