Build.scala: specify scala version does not work - scala

I use playframework and here is my appDependencies in Build.scala:
val appDependencies = Seq(
// Add your project dependencies here,
jdbc,
anorm,
"com.rabbitmq" % "amqp-client" % "3.0.1",
"com.typesafe.akka" %% "akka-agent" % "2.1.0",
"org.mongodb" %% "casbah" % "2.5.0",
"com.novus" % "salat_2.9.1" % "1.9.1",
"se.radley" % "play-plugins-salat_2.9.1" % "1.1"
)
There are no salat and play-salat plugins for scala 2.10 so I specify scala version explicitly. But it takes no effect:
[info] Updating {file:/home/johndoe/projects/myproject/}myproject...
[warn] module not found: com.novus#salat_2.10;1.9.1
[warn] ==== local: tried
[warn] /home/johndoe/projects/lib/play/repository/local/com.novus/salat_2.10/1.9.1/ivys/ivy.xml
[warn] ==== Typesafe Releases Repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/com/novus/salat_2.10/1.9.1/salat_2.10-1.9.1.pom
[warn] ==== Typesafe Snapshots Repository: tried
[warn] http://repo.typesafe.com/typesafe/snapshots/com/novus/salat_2.10/1.9.1/salat_2.10-1.9.1.pom
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/com/novus/salat_2.10/1.9.1/salat_2.10-1.9.1.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.novus#salat_2.10;1.9.1: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[error] (*:update) sbt.ResolveException: unresolved dependency: com.novus#salat_2.10;1.9.1: not found
[warn] some of the dependencies were not recompiled properly, so classloader is not avaialable
[info] Updating {file:/home/johndoe/projects/myproject/}myproject...
[warn] module not found: com.novus#salat_2.10;1.9.1
[warn] ==== local: tried
[warn] /home/johndoe/projects/lib/play/repository/local/com.novus/salat_2.10/1.9.1/ivys/ivy.xml
[warn] ==== Typesafe Releases Repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/com/novus/salat_2.10/1.9.1/salat_2.10-1.9.1.pom
[warn] ==== Typesafe Snapshots Repository: tried
[warn] http://repo.typesafe.com/typesafe/snapshots/com/novus/salat_2.10/1.9.1/salat_2.10-1.9.1.pom
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/com/novus/salat_2.10/1.9.1/salat_2.10-1.9.1.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.novus#salat_2.10;1.9.1: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[error] (*:update) sbt.ResolveException: unresolved dependency: com.novus#salat_2.10;1.9.1: not found
What am I missing?

Salat 1.9.2-SNAPSHOT is available for 2.10.

And let me acknowledge my ignorance: the reason was that I failed to run play command every time I modified Build.scala. The only thing I tried was run, again and again.

Related

Can't install Plotly in Scala

I've started to learn Scala recently for machine learning purpose and i need plotly to draw my plots.
The fact is after following all installation
steps on their site i get this error :
sbt:DAY_01> run
[info] Updating ...
[warn] module not found: co.theasi#plotly_2.12;0.2.0
[warn] ==== local: tried
[warn] /Users/lucasclerisse/.ivy2/local/co.theasi/plotly_2.12/0.2.0/ivys/ivy.xml
[warn] ==== public: tried
[warn] https://repo1.maven.org/maven2/co/theasi/plotly_2.12/0.2.0/plotly_2.12-0.2.0.pom
[warn] ==== local-preloaded-ivy: tried
[warn] /Users/lucasclerisse/.sbt/preloaded/co.theasi/plotly_2.12/0.2.0/ivys/ivy.xml
[warn] ==== local-preloaded: tried
[warn] file:////Users/lucasclerisse/.sbt/preloaded/co/theasi/plotly_2.12/0.2.0/plotly_2.12-0.2.0.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: co.theasi#plotly_2.12;0.2.0: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Unresolved dependencies path:
[warn] co.theasi:plotly_2.12:0.2.0 (/Users/lucasclerisse/Documents/Ecole/Piscine_IA_POC/DAY_01/build.sbt#L7-8)
[warn] +- default:day_01_2.12:1.1.0
[error] sbt.librarymanagement.ResolveException: unresolved dependency: co.theasi#plotly_2.12;0.2.0: not found
Here is my sbt.build :
name := "DAY_01"
version := "1.1.0"
scalaVersion := "2.12.4"
libraryDependencies += "co.theasi" %% "plotly" % "0.2.0"
I tried to downgrade my sbt version and another ploty version, but it didn't work.
This is the exact library dependency:
libraryDependencies += "co.theasi" % "plotly_2.11" % "0.2.0"
in your code sbt is trying to look for plotly dependency for scala version 2.12, which I guess is not available. As while going through there documentation, it looks that the latest version supports scala 2.11.
You can check here: click

sbt unresolved dependency: scala parser combinators

I am trying to use scala parser combinators in my scala project.
The only .sbt file I have in my project is project/build.sbt:
libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.4"
I tried adding this line to build/project.sbt
resolvers += "Typesafe Repo" at "http://repo.typesafe.com/typesafe/releases/"
but I get the exact same error.
When I execute sbt from the terminal in the root directory of my project I obtain the following dependency error (those are the last lines before the error):
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.scala-lang.modules#scala-parser-combinators_2.10;1.0.4: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Unresolved dependencies path:
[warn] org.scala-lang.modules:scala-parser-combinators_2.10:1.0.4 (/home/simonlbc/workspace/examslenstra/project/build.sbt#L7-8)
[warn] +- default:examslenstra-build:0.1-SNAPSHOT (scalaVersion=2.10, sbtVersion=0.13)
sbt.ResolveException: unresolved dependency: org.scala-lang.modules#scala-parser-combinators_2.10;1.0.4: not found
[error] (*:update) sbt.ResolveException: unresolved dependency: org.scala-lang.modules#scala-parser-combinators_2.10;1.0.4: not found
there are several lines which are it seems attempt from sbt to resolve the plugin at several different repositories:
[warn] module not found: org.scala-lang.modules#scala-parser-combinators_2.10;1.0.4
[warn] ==== typesafe-ivy-releases: tried
[warn] https://repo.typesafe.com/typesafe/ivy-releases/org.scala-lang.modules/scala-parser-combinators_2.10/1.0.4/ivys/ivy.xml
[warn] ==== sbt-plugin-releases: tried
[warn] https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scala-lang.modules/scala-parser-combinators_2.10/1.0.4/ivys/ivy.xml
[warn] ==== local: tried
[warn] /home/simonlbc/.ivy2/local/org.scala-lang.modules/scala-parser-combinators_2.10/1.0.4/ivys/ivy.xml
[warn] ==== activator-launcher-local: tried
[warn] /home/simonlbc/.activator/repository/org.scala-lang.modules/scala-parser-combinators_2.10/1.0.4/ivys/ivy.xml
[warn] ==== activator-local: tried
[warn] /home/simonlbc/workspace/DB/DB2016/server/activator-dist-1.3.10/repository/org.scala-lang.modules/scala-parser-combinators_2.10/1.0.4/ivys/ivy.xml
[warn] ==== typesafe-releases: tried
[warn] http://repo.typesafe.com/typesafe/releases/org/scala-lang/modules/scala-parser-combinators_2.10/1.0.4/scala-parser-combinators_2.10-1.0.4.pom
[warn] ==== typesafe-ivy-releasez: tried
[warn] http://repo.typesafe.com/typesafe/ivy-releases/org.scala-lang.modules/scala-parser-combinators_2.10/1.0.4/ivys/ivy.xml
[warn] ==== sbt-releases-repo: tried
[warn] http://repo.typesafe.com/typesafe/ivy-releases/org.scala-lang.modules/scala-parser-combinators_2.10/1.0.4/ivys/ivy.xml
[warn] ==== sbt-plugins-repo: tried
[warn] http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scala-lang.modules/scala-parser-combinators_2.10/1.0.4/ivys/ivy.xml
[warn] ==== maven-central: tried
[warn] http://repo1.maven.org/maven2/org/scala-lang/modules/scala-parser-combinators_2.10/1.0.4/scala-parser-combinators_2.10-1.0.4.pom
[warn] ==== Typesafe Repo: tried
[warn] http://repo.typesafe.com/typesafe/releases/org/scala-lang/modules/scala-parser-combinators_2.10/1.0.4/scala-parser-combinators_2.10-1.0.4.pom
To write my project/build.sbt file I followed the directive given by the github repository of the scala parser combinators.
Of course when I do not specify anything in project/build.sbt I get compile time errors from sbt which does not understand where the Parser classes source files are.
Would there be any in which I could configure project/build.sbt so that I can use Scala's parser combinators library?
Based on this part of the error:
[warn] Note: Unresolved dependencies path:
[warn] org.scala-lang.modules:scala-parser-combinators_2.10:1.0.4
^
It looks like you're using Scala 2.10, where parser combinators are part of the standard library. They were split from the standard library as of Scala 2.11, so the jar you're looking for doesn't exist. If you're sticking with 2.10, simply remove that dependency, you'll get it in the standard library.

Strange error when using processing library from maven central in a sbt project

I am trying to use the processing java library in a sbt project, so I added a line in build.sbt:
name := "testJson"
version := "1.0"
scalaVersion := "2.11.7"
//libraryDependencies += "io.spray" %% "spray-json" % "1.3.2"
libraryDependencies += "org.processing" % "processing-complete" % "3.0b5"
I got an error:
[warn]
[FAILED ] org.processing#processing-complete;3.0b5!processing-complete.jar: (0ms)
[warn] ==== local: tried
[warn] /Users/kaiyin/.ivy2/local/org.processing/processing-complete/3.0b5/jars/processing-complete.jar
[warn] ==== activator-launcher-local: tried
[warn] /Users/kaiyin/.activator/repository/org.processing/processing-complete/3.0b5/jars/processing-complete.jar
[warn] ==== activator-local: tried
[warn] /Users/kaiyin/opt/activator-dist-1.3.5/repository/org.processing/processing-complete/3.0b5/jars/processing-complete.jar
[warn] ==== public: tried
[warn] https://repo1.maven.org/maven2/org/processing/processing-complete/3.0b5/processing-complete-3.0b5.jar
[warn] ==== typesafe-releases: tried
[warn] http://repo.typesafe.com/typesafe/releases/org/processing/processing-complete/3.0b5/processing-complete-3.0b5.jar
[warn] ==== typesafe-ivy-releasez: tried
[warn] http://repo.typesafe.com/typesafe/ivy-releases/org.processing/processing-complete/3.0b5/jars/processing-complete.jar
[warn]
[FAILED ] org.processing#processing-complete;3.0b5!processing-complete.jar(src): (0ms)
[warn] ==== local: tried
[warn] /Users/kaiyin/.ivy2/local/org.processing/processing-complete/3.0b5/srcs/processing-complete-sources.jar
[warn] ==== activator-launcher-local: tried
[warn] /Users/kaiyin/.activator/repository/org.processing/processing-complete/3.0b5/srcs/processing-complete-sources.jar
[warn] ==== activator-local: tried
[warn] /Users/kaiyin/opt/activator-dist-1.3.5/repository/org.processing/processing-complete/3.0b5/srcs/processing-complete-sources.jar
[warn] ==== public: tried
[warn] https://repo1.maven.org/maven2/org/processing/processing-complete/3.0b5/processing-complete-3.0b5-sources.jar
[warn] ==== typesafe-releases: tried
[warn] http://repo.typesafe.com/typesafe/releases/org/processing/processing-complete/3.0b5/processing-complete-3.0b5-sources.jar
[warn] ==== typesafe-ivy-releasez: tried
[warn] http://repo.typesafe.com/typesafe/ivy-releases/org.processing/processing-complete/3.0b5/srcs/processing-complete-sources.jar
[warn]
[FAILED ] org.processing#processing-complete;3.0b5!processing-complete.jar(doc): (0ms)
[warn] ==== local: tried
[warn] /Users/kaiyin/.ivy2/local/org.processing/processing-complete/3.0b5/docs/processing-complete-javadoc.jar
[warn] ==== activator-launcher-local: tried
[warn] /Users/kaiyin/.activator/repository/org.processing/processing-complete/3.0b5/docs/processing-complete-javadoc.jar
[warn] ==== activator-local: tried
[warn] /Users/kaiyin/opt/activator-dist-1.3.5/repository/org.processing/processing-complete/3.0b5/docs/processing-complete-javadoc.jar
[warn] ==== public: tried
[warn] https://repo1.maven.org/maven2/org/processing/processing-complete/3.0b5/processing-complete-3.0b5-javadoc.jar
[warn] ==== typesafe-releases: tried
[warn] http://repo.typesafe.com/typesafe/releases/org/processing/processing-complete/3.0b5/processing-complete-3.0b5-javadoc.jar
[warn] ==== typesafe-ivy-releasez: tried
[warn] http://repo.typesafe.com/typesafe/ivy-releases/org.processing/processing-complete/3.0b5/docs/processing-complete-javadoc.jar
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: FAILED DOWNLOADS ::
[warn] :: ^ see resolution messages for details ^ ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.processing#processing-complete;3.0b5!processing-complete.jar
[warn] :: org.processing#processing-complete;3.0b5!processing-complete.jar(src)
[warn] ::
What does it mean and how can it be solved?
Although the pom is there, the artifact isn't. See http://search.maven.org/#search%7Cga%7C1%7Corg.processing . Here you can see what artifacts are available for which poms. I suspect the core artifact may be what you want.
You're not defining any resolver.
You might you want to try to add this line to your build.sbt:
resolvers += Resolver.sonatypeRepo("releases")
Or check out this page that explains resolvers in more details: http://www.scala-sbt.org/0.13/docs/Resolvers.html
The processing-complete module is just a meta file describing the modules a processing.org offers. I would have expected that sbt/ivy would be able to resolve the modules defined in the pom file. However, if it does not (I didn't get sbt to download anything other then the pom), I'd suggest that you add the actual modules individually:
libraryDependencies += "org.processing" % "core" % "3.0b5"
libraryDependencies += "org.processing" % "net" % "3.0b5"
libraryDependencies += "org.processing" % "video" % "3.0b5"
libraryDependencies += "org.processing" % "serial" % "3.0b5"
libraryDependencies += "org.processing" % "pde" % "3.0b5"
libraryDependencies += "org.processing" % "pdf" % "3.0b5"
which works smoothly for me.

Spray io - unable to resolve an error about dependencies in sbt

I can't try any example from spay.io since I can't resolve an error about dependencies in build.sbt. Here is how it looks like:
//....skipped
resolvers += "spray repo" at "http://repo.spray.io"
libraryDependencies += "io.spray" % "spray-can" % "1.0"
It gives me an error, however:
[info] Resolving io.spray#spray-can;1.0 ...
[warn] module not found: io.spray#spray-can;1.0
[warn] ==== local: tried
[warn] /home/alex/.ivy2/local/io.spray/spray-can/1.0/ivys/ivy.xml
[warn] ==== Typesafe Repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/io/spray/spray-can/1.0/spray-can-1.0.pom
[warn] ==== spray repo: tried
[warn] http://repo.spray.io/io/spray/spray-can/1.0/spray-can-1.0.pom
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/io/spray/spray-can/1.0/spray-can-1.0.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: io.spray#spray-can;1.0: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: unresolved dependency: io.spray#spray-can;1.0: not found
//..................................... skipped
[error] (*:update) sbt.ResolveException: unresolved dependency: io.spray#spray-can;1.0: not found
Even when I change the version to be 1.1, I still have the same error.
What's wrong with that?
There is no version 1.0 of spray yet, according to the docs (and browsing the repo): see spray - Current Versions.
The latest seems to be either 1.0-M7 for scala 2.9.2 or 1.1-M7 for scala 2.10.0-RC5.

Using Google Ads APIs with play and scala, how do you correctly add dependencies?

I'm trying to add the necessary dependencies for google's ad api to a play app written in scala.
My problem is that all the examples are for java and I can't get it to work for scala.
I've been looking at this setup guide:
https://code.google.com/p/google-api-ads-java/
I took the dependencies for sbt from this site:
http://mvnrepository.com/artifact/com.google.api-ads
Build.scala:
val appDependencies = Seq(
//won't work, sbt can't resolve the RELEASE version
"com.google.api-ads" % "ads-lib" % "RELEASE"
)
val appDependencies = Seq(
//won't work either, see error below
"com.google.api-ads" % "ads-lib" % "1.8.0"
)
[warn] module not found: com.google.api-client#google-api-client;RELEASE
[warn] ==== local: tried
[warn] /home/rawphl/Coding/play-2.0.3/framework/../repository/local/com.google.api- client/google-api-client/RELEASE/ivys/ivy.xml
[warn] ==== Typesafe Releases Repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/com/google/api-client/google-api-client/RELEASE/google-api-client-RELEASE.pom
[warn] ==== Typesafe Snapshots Repository: tried
[warn] http://repo.typesafe.com/typesafe/snapshots/com/google/api-client/google-api-client/RELEASE/google-api-client-RELEASE.pom
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/com/google/api-client/google-api-client/RELEASE/google-api-client-RELEASE.pom
[warn] module not found: com.google.oauth-client#google-oauth-client;RELEASE
[warn] ==== local: tried
[warn] /home/rawphl/Coding/play-2.0.3/framework/../repository/local/com.google.oauth-client/google-oauth-client/RELEASE/ivys/ivy.xml
[warn] ==== Typesafe Releases Repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/com/google/oauth-client/google-oauth-client/RELEASE/google-oauth-client-RELEASE.pom
[warn] ==== Typesafe Snapshots Repository: tried
[warn] http://repo.typesafe.com/typesafe/snapshots/com/google/oauth-client/google-oauth-client/RELEASE/google-oauth-client-RELEASE.pom
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/com/google/oauth-client/google-oauth-client/RELEASE/google-oauth-client-RELEASE.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.google.api-client#google-api-client;RELEASE: not found
[warn] :: com.google.oauth-client#google-oauth-client;RELEASE: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
I'm not sure how to proceed right now. I guess I'm just missing some dependencies, but I can't quite figure out what the prefered way of adding the google api is.
Use 1.9.0 and it will be fine. More generally, check dependencies, check versions, randomize the values and pray.