Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Open
DaGenix opened this Issue · 6 comments

6 participants

@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

@Centaur

Yes. So are the "provided" project dependencies.

@hseeberger

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

@elyast

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'!
@estebandonato

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

@elyast

@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'!
@cretz

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.