Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9215919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:18:33+00:00 2026-06-18T02:18:33+00:00

It’s easy to declare managed library dependencies in SBT, eg libraryDependencies ++= Seq( org.specs2

  • 0

It’s easy to declare managed library dependencies in SBT, eg

 libraryDependencies ++= Seq(
 "org.specs2" %% "specs2" % "1.12.2" % "test" ,
 "junit" % "junit" % "4.7" % "test"
)

And while it’s not as easy to declare project dependencies in SBT, I can do that too:

object RichMath extends Build {
  lazy val myApp = Project("RichMath", file(".")) dependsOn(richUtil)   
  lazy val richUtil = RootProject(file("../RichUtil"))
}

But in practice, I typically want to change between project mode, where changes are immediately visible in upstream projects, and library mode, where I must publish changes to see them in dependent projects, as code matures.

Early in code-base’s life, or whenever I’m wanting to make frequent changes across modules, I don’t want the hassle of re-publishing just to see changes upstream. But in stable/mature code, I want to specify exactly what version’s I’m depending upon.

It seems like SBT treats the two dependencies as completely different. Is there a more straight-forward way to switch between project- and library- dependencies than rewriting my build definition?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T02:18:34+00:00Added an answer on June 18, 2026 at 2:18 am

    I have a few scenarios for my sbt scripts (tests, publishing, production). I start sbt from script (from bash, you may have other environment) with DO=TESTS sbt for example. This is my dynamic dependencies with regard of environment variable:

    if (sys.env.contains("LOCAL_BUILD")) {
      Seq[Project.Setting[_]](
        unmanagedResourceDirectories in Compile <+= baseDirectory { _ / "src" / "main" / "scala" },
        libraryDependencies ++= {
          Seq(
            "org.digimead" %% "digi-lib-slf4j" % "0.2.1-SNAPSHOT" % "test",
            "org.digimead" %% "digi-lib-test" % "0.2.1-SNAPSHOT" % "test",
            "org.scalatest" %% "scalatest" % "1.9" % "test"
          )
        }
      )
    } else {
      Seq[Project.Setting[_]](
       libraryDependencies ++= {
          Seq(
            "org.slf4j" % "slf4j-log4j12" % "1.7.1"
          )
        }
      )
    }
    

    As you can see I may have different project settings with single .sbt definition controlled by one environment variable. The environment variable affect all project/subproject bunch.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not entirely sure how I managed to jack this up. http://pretty-senshi.com If you
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I need a function that will clean a strings' special characters. I do NOT
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.