i need sbt 0.11.2 to build the mongo auth app for lift - scala

For some reason sbt bails on .11.3 when working with the mongodb-record auth project, and it seems to me that's the only version i can download from the git site.

The idiomatic way is to specify sbt version in build.properties as
sbt.version=0.11.2
But since group id in 0.11.3 was changed from org.scala-tools.sbt to org.scala-sbt, sbt can't resolve older versions. But you still can manually download older version of launcher from typesafe repo.

Related

How to install and maintain 2 versions of sbt(say 1.2.7 and 1.2.8) on windows 10 without any library issues?

I'm working on 2 different projects in which the sbt version of project-1 in build.properties is 1.2.7 and the project-2 is 1.2.8, and I cannot make both versions of sbt in build.properties the same.
As a workaround 'how can I maintain 2 sbt versions on my windows 10 to run those 2 projects separately?
Thank you All in Advance.
The sbt project version does not need to match the installed sbt version. When you start sbt on a project that specifies v1.2.8 in its build.properties, the sbt launcher will download the appropriate sbt version if necessary and build your project with it. This mechanism is both backward and forward compatible.
Plugins in a given sbt project must be compatible with the version declared in build.properties, but not necessarily with the installed version.

Install sbt from source

Because in my operating system distribution has not default package sbt, I try compile from source and install sbt package locally (https://github.com/sbt/sbt). Unfortunately I can not do it and I can not find any guide to do this without installed sbt. To compile sbt from source is needed sbt? What can I to do to install sbt from source?
The answer is yes: to build sbt from source, you need to install sbt first (obviously, not from source). There are instructions for Building sbt from source and they start with
Install the current stable binary release of sbt (see Setup), which will be used to build sbt from source.
If you have a concrete problem installing sbt from binaries, you should solve it first. You can ask for help with it in a new question.

Why does sbt report "Error: Could not retrieve sbt 0.13.11"?

In a Scala project I updated the build.properties from 0.13.8 to 0.13.11. That "broke" sbt as it does not start anymore, i.e. it cannot download the 0.13.11 jars?! sbt prints a list of tried repo's, but the repo.typesafe.com was not one of them.
My local installed sbt is 0.13.8.
For some reason the scala-sbt jars are not available anymore in Typesafe's Bintray. Largest version there is 0.13.9.
I know the place to get it is https://repo.typesafe.com/typesafe/ivy-releases/, but how do I tell sbt to use this repo?
I have already tried:
adding a resolver to plugins.sbt
adding a resolver to build.sbt
adding the repo to .sbt/repositories
but I cannot get it working.
How to tell sbt where to get binaries?
Make sure that you're using sbt (launcher) that's at the same version of higher than the version used in your project.
Execute sbt about in an empty directory and find [info] This is sbt X.Y.X.
Make sure that you don't use ~/.sbt/repositories file that sets up the repositories used to resolve artifacts.
try to set your https proxy Information into http.proxyHost and http.proxyPort. This solved it for me.

Sbt 0.12.4+ required on project import

I'm currently reading the Play for Scala: Covers Play 2 book by Peter Hilton (publisher: Manning) , and trying to stick to the versions they've outlined in the book (Play version 2.1.1).
I downloaded the new IntelliJ IDEA 14 CE app and installed it. I'm currently importing the project, and it's failing because it wants a version of sbt that is 0.12.4 or greater.
This issue occurred in 13 the other day, but I haven't had time to resolve it, so please, no recommendations to go back to 13 :)
Here is the meat of the issue:
When I type sbt --version on the CLI, it prints sbt launcher version 0.13.6. I have a "greater" version, but it appears that IDEA doesn't recognize this.
In an effort to specify my own SBT launcher JAR, I pointed my custom launcher (in IDEAs global settings) to the one in /usr/local/Cellar/sbt/0.13.6/libexec/sbt-launch.jar, but the build also failed with the same error.
As you may have guessed at this point, I have used Homebrew to install and manage Scala and sbt. When I first started working with Scala back in February, I remember having to make a few small tweaks in my settings to get IDEA to find Scala, but my version of IDEA 14 is totally fresh -- I did not import any previous settings. I downloaded the Scala and sbt plugins and they appear to be properly configured after a cursory look and creation of a new test project.
Here is what I'm failing to understand:
First, and most obvious, why would an sbt version that meets the supposed requirement (0.12.4+) fail with version 0.13.*?
Second, is the bundled sbt with IDEA also greater than this version? Is there possibly an sbt flag somewhere in my system that's pointing it to an earlier version? A side note, I have a few versions of sbt in my "Cellar", but all are greater than 0.13.
Many thanks for your help!
I had a look at the code samples from Manning's website, and the project/build.properties files for each project specify sbt.version=0.12.2. My guess is that the Intellij Scala plugin only supports SBT 0.12.4, and cannot import you project which is configured to use an older version (hence why it recommends that you "update your project definition").
You should try using sbt.version=0.12.4 in the project/build.properties file.
Generally speaking, keep in mind that when an SBT version is specified in project/build.properties, the SBT launcher downloads the specified version and uses it to build the project. In your case, that means that the SBT 0.13.6 launcher will download SBT 0.12.2 and use that version to build the project.

Do you need to install Scala separately if you use sbt?

Reason I ask, is because it's possible to specify a Scala version in the build.sbt file (using scalaVersion setting), and once you do that, sbt will automatically download that Scala version to use with the project.
I also seem to remember that despite having Scala 2.11.1 on my system, sbt would compile and run with Scala 2.10 if no version was specified.
So the question is, do I need to install Scala separately if I got sbt installed?
No you don't need it. sbt will download Scala for you.
If you install sbt-extras (basically just a script) you don't even need to download sbt: it will automatically download the sbt launcher you need. Very handy since you just need to specify sbt.version in your build.properties and you're good to go.
Edit: removed my comment about not being able to do sbt console in an empty directory, since both sbt and sbt-extras support it now.