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 7895667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:41:54+00:00 2026-06-03T07:41:54+00:00

I have a project built with sbt 0.11. I’m trying to create a simple

  • 0

I have a project built with sbt 0.11.
I’m trying to create a simple UI with Scala Swing, so first thing is to add a dependency on scala-swing in my build.sbt:

libraryDependencies += "org.scala-lang" % "scala-swing" % "2.9.1-1"

But I have a SettingKey scalaVersion defined:

scalaVersion := "2.9.1-1"

How can I reference that property? If I try to use it like

libraryDependencies += "org.scala-lang" % "scala-swing" % scalaVersion

Compiler complains that it found sbt.SettingKey[String] while String is expected. There are methods get(...) and evaluate(...) on SettingKey but they require some Setting[Scope] parameter to be passed in.

What is the simplest way to just reference this property?

  • 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-03T07:41:56+00:00Added an answer on June 3, 2026 at 7:41 am

    You need to tell the system that libraryDependencies now depends on scalaVersion:

    libraryDependencies <+= (scalaVersion) { sv => "org.scala-lang" % "scala-swing" % sv }
    

    (that’s my preferred formatting; it’s actually invoking the apply method on scalaVersion so you could write it a few different ways, e.g., scalaVersion("org.scala-lang" % "scala-swing" % _).)

    If you had multiple settings you wanted to depend on simultaneously, you’d apply on the tuple of them:

    foo <<= (scalaVersion, organization) { (sv, o) => o + " uses Scala " + sv }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get SBT to build a project that could have more than
I am using SBT as my build tool for building a Scala project. My
I have a simple project built with Eclipse 3.4 (aka IBM RAD) on WebSphere
I have a Windows Installer project built for my VSTO add-in. However, I have
I have a simple mfc project built on a CDialog. I also have a
I have a build.sbt file in my project root.. all my source files live
I have a Scalatra project with the following build.sbt organization := com.example name :=
I'm new to Scala, SBT and Specs. I have created a simple specification using
I have downloaded a project which uses sbt as its build system and I
well, I'm a newbie to both SBT and Scala, and I'm trying to create

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.