Re: [sbt] When running from sbt 0.12.x interactive shell, how can I add a provided dependency to the classpath

20 views
Skip to first unread message

Doug Tangren

unread,
Mar 3, 2013, 4:35:00 PM3/3/13
to simple-b...@googlegroups.com


On Mar 3, 2013 4:17 PM, "Gary Malouf" <malou...@gmail.com> wrote:
>
> When you use Twitter Storm, they support the idea of a local mode for testing out apps.  Having said that, when you deploy to a storm cluster the storm jars should NOT be included in your jar.  Many of the example projects work around this by being maven projects and using the compile classpath to run locally. 
>
> With sbt, I would like to do this same thing.  Is there some argument I can give to the 'run' task in my project such that it will use the compile classpath rather than the runtime one?  An even better option would be to be able to add just storm and it's transitive dependencies at runtime.
>

It sounds like you want to declare your storm dependency in a "provided" scope. This is similar to test. It assumes the dependency will be provided in the target deployment env. Sbt will add it only to compile and run but not package it.

> --
> 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.
> To post to this group, send email to simple-b...@googlegroups.com.
> Visit this group at http://groups.google.com/group/simple-build-tool?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

Gary Malouf

unread,
Mar 3, 2013, 4:48:25 PM3/3/13
to simple-b...@googlegroups.com
I thought the title implied it, but yes I already have storm as a 'provided' dependency.  Unfortunately, the library I was dealing with had their examples in the src/main package as opposed to src/test.  I've since moved them to work around the problem I am describing.
Reply all
Reply to author
Forward
0 new messages