How to install multiple versions of sbt on my Linux host?

How to install multiple versions of sbt on my Linux host

For example, some projects use 0.12.x while some use 0.13.x. Installing neither in the system only is not sufficient enough.

You may use the excellent sbt-extras: https://github.com/paulp/sbt-extras

Most of the time, it detects the version of sbt needed in the project direoctory automatically:

[zma@office Md2BlogText]$ sbt about
[info] Loading global plugins from /home/zma/.sbt/0.13/plugins
[info] Loading project definition from /home/zma/project/zma-etc/scala/Md2BlogText/project
[info] Set current project to md2blogtext (in build file:/home/zma/project/zma-etc/scala/Md2BlogText/)
[info] This is sbt 0.13.2
[info] The current project is {file:/home/zma/project/zma-etc/scala/Md2BlogText/}md2blogtext 0.1-SNAPSHOT
[info] The current project is built against Scala 2.10.3
[info] Available Plugins: com.dscleaver.sbt.SbtQuickFix, org.ensime.sbt.Plugin
[info] sbt, sbt plugins, and build definitions are using Scala 2.10.3

[zma@office Md2BlogText]$ cd ../progfun-004/example/
[zma@office example]$ sbt about
[info] Loading project definition from /home/zma/project/zma-etc/scala/progfun-004/example/project/project
[info] Loading project definition from /home/zma/project/zma-etc/scala/progfun-004/example/project
[info] Set current project to progfun-example (in build file:/home/zma/project/zma-etc/scala/progfun-004/example/)
[info] This is sbt 0.12.4
[info] The current project is {file:/home/zma/project/zma-etc/scala/progfun-004/example/}assignment
[info] The current project is built against Scala 2.10.2
[info] Available Plugins: com.typesafe.sbteclipse.plugin.EclipsePlugin
[info] sbt, sbt plugins, and build definitions are using Scala 2.9.2

Note that 0.13.2 and 0.12.4 of sbt are started although the command are the same as sbt in different project directories (and different versions of scala).

Or, you can specify the sbt version needed (e.g. 0.12.4):

sbt -sbt-version 0.12.4
Answered by Eric Z Ma.

Eric Z Ma

Eric is a father and systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.

Leave a Reply

Your email address will not be published. Required fields are marked *