Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Open
DaGenix opened this Issue · 3 comments

4 participants

DaGenix oldpig Heiko Seeberger Lukasz Jastrzebski
DaGenix

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: https://github.com/DaGenix/eclipse-sources-provided-problem.git

oldpig

Yes. So are the "provided" project dependencies.

Heiko Seeberger
Owner

Have you tried to add Provided to the configurations setting? See the Wiki: https://github.com/typesafehub/sbteclipse/wiki/Using-sbteclipse

Lukasz Jastrzebski

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'!
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.