0

I have not code for a few years and now trying to get back into the game. I am trying to set up a very simple scala project HelloWorld and getting the following error message when I try to compile from sbt console. I was adding sbteclipse plugin to generate eclipse project setting.

[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.typesafe.sbteclipse#sbteclipse-plugin;4.0.0: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn]  Note: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.
[warn]      com.typesafe.sbteclipse:sbteclipse-plugin:4.0.0 (scalaVersion=2.11, sbtVersion=0.13)
[warn]
[warn]  Note: Unresolved dependencies path:
[warn]      com.typesafe.sbteclipse:sbteclipse-plugin:4.0.0 (scalaVersion=2.11, sbtVersion=0.13) (/Users/michael/Development/Scala-Testings/HelloWorld/project/plugins.sbt#L3-4)
[warn]        +- default:helloworld-build:0.1-SNAPSHOT (scalaVersion=2.11, sbtVersion=0.13)
sbt.ResolveException: unresolved dependency: com.typesafe.sbteclipse#sbteclipse-plugin;4.0.0: not found

I am on macOS Sierra with scala version 2.11.8 and sbt 0.13.12 installed from brew.

Project Directory Structure

src
+- main
   +- scala
      +- HelloWorld.scala
project
+- plugins.sbt
build.sbt

Content of build.sbt

name := "HelloWorld"

version := "1.0"

scalaVersion := "2.11.8"

Content of plugins.sbt

logLevel := Level.Warn

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")

Content of HelloWorld.scala

object HelloWorld extends App {
    def main (args Array[String]) : Unit = {
        println ("HelloWorld!")
    }
}
Michael
  • 163
  • 2
  • 7
  • WFM. eclipse command runs. Is that good news or bad news? You will find two errors in your code when sbt finally tries to compile it. – som-snytt Sep 20 '16 at 19:15
  • does it need a resolver? I would recommend to install activator and the run `activator new`: http://www.lightbend.com/community/core-tools/activator-and-sbt – pedrorijo91 Sep 20 '16 at 19:53
  • Yeah, I got it working by removing addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0") from project_folder/project/plugins.sbt and putting in ~/.sbt/0.13/plugins/plugins.sbt file. – Michael Sep 21 '16 at 09:31

1 Answers1

0

The issue is has to do with sbt version 0.13.12 which is compiled with Scala version 2.10.x while I have Scala 2.11.8 installed.

I got it working by removing

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")

from

project_folder/project/plugins.sbt

and putting in

~/.sbt/0.13/plugins/plugins.sbt file.
Michael
  • 163
  • 2
  • 7