Marking inter-module dependencies as "provided"

289 views
Skip to first unread message

Matei Zaharia

unread,
Aug 22, 2013, 8:04:35 PM8/22/13
to simple-b...@googlegroups.com
I have a project with a "core" module that brings in a bunch of dependencies, and an "examples" module that depends on core and also brings out a few other JARs. When I build an assembly for the project, I want the "examples" assembly to have everything that examples depends on that isn't in core (or in core's dependencies). Is there a way I can configure the build to do that?

I tried doing the following:

  lazy val core = Project("core", file("core"), settings = coreSettings)

  lazy val examples = Project("examples", file("examples"), settings = examplesSettings) dependsOn(core % "provided")

But SBT (0.12.4) gives the following error when I try to build:

java.lang.IllegalStateException: impossible to get artifacts when data has not been loaded. IvyNode = org.slf4j#slf4j-api;1.6.1
at org.apache.ivy.core.resolve.IvyNode.getArtifacts(IvyNode.java:779)
at org.apache.ivy.core.resolve.IvyNode.getSelectedArtifacts(IvyNode.java:756)
at org.apache.ivy.core.report.ResolveReport.setDependencies(ResolveReport.java:235)
at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:234)
at org.apache.ivy.Ivy.resolve(Ivy.java:513)
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:208)
at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:122)
at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:121)

My guess is that the dependency scope for projects doesn't support the "provided" dependencies available for Maven artifacts. Is there any other way to do this? The only way I've thought of is making "examples" be a completely separate SBT project that you can only build after you publish "core".

Issac Buenrostro

unread,
May 27, 2014, 7:55:56 PM5/27/14
to simple-b...@googlegroups.com
Hello Matei,
Did you find a solution for this issue? We are encountering the exact same problem with spark-1.0.0.SNAPSHOT.
Thanks!
Issac

Matei Zaharia

unread,
May 27, 2014, 8:50:39 PM5/27/14
to simple-b...@googlegroups.com
I don’t think we figured this out unfortunately. We now make binary distributions with Maven.

Matei

--
You received this message because you are subscribed to a topic in the Google Groups "simple-build-tool" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/simple-build-tool/UhSSJkIu1RM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to simple-build-t...@googlegroups.com.
To post to this group, send email to simple-b...@googlegroups.com.
Visit this group at http://groups.google.com/group/simple-build-tool.
For more options, visit https://groups.google.com/d/optout.

Josh Suereth

unread,
May 31, 2014, 10:00:31 AM5/31/14
to simple-b...@googlegroups.com

This should work, actually but it's hard to tell without more detail.

Are you using the sbt assembly plugin?

You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simple-build-t...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages