Slick for Scala compiler version 2.9.1 - scala

I am trying to install slick in to my build.sbt this way:
name := "project"
version := "1.0"
scalaVersion := "2.9.1"
libraryDependencies += "com.typesafe.slick" %% "slick" % "1.0.1"
and I am getting a an error when I am running my sbt
> run
[info] Updating {file:/home/chris/project/}project...
[info] Resolving com.typesafe.slick#slick_2.9.1;1.0.1 ...
[warn] module not found: com.typesafe.slick#slick_2.9.1;1.0.1
[warn] ==== local: tried
[warn] /home/chris/.ivy2/local/com.typesafe.slick/slick_2.9.1/1.0.1/ivys/ivy.xml
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/com/typesafe/slick/slick_2.9.1/1.0.1/slick_2.9.1-1.0.1.pom
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.typesafe.slick#slick_2.9.1;1.0.1: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[trace] Stack trace suppressed: run last *:update for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency: com.typesafe.slick#slick_2.9.1;1.0.1: not found
[error] Total time: 9 s, completed Sep 12, 2013 5:09:25 PM
The url in the error is not available, my question is where can I get the code for this specific version if I cannot get it from that public url, and once I have the code where do I install it to?

Slick is unfortunately not available for Scala 2.9, as it takes advantage of features available in Scala 2.10+.
You can however utilize ScalaQuery, which is the spiritual predecessor to Slick and shares much of its design and features. Stefan Zeiger, who wrote ScalaQuery, now works for us at Typesafe on Slick.

Related

Dependency for cassandra phantom

I have following bulid.sbt
scalaVersion := "2.11.8"
libraryDependencies += "com.websudos" %% "diesel-engine" % "0.3.0"
libraryDependencies += "com.websudos" %% "phantom-dsl" % "1.27.0"
When sbt try resolve dependency following communicate is showing:
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.websudos#diesel-engine_2.11;0.3.0: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Unresolved dependencies path:
[warn] com.websudos:diesel-engine_2.11:0.3.0 (/path/build.sbt#L13-14)
[warn] +- com.websudos:phantom-dsl_2.11:1.27.0 (/path/build.sbt#L15-16)
[warn] +- default:webscraper_2.11:1.0
[trace] Stack trace suppressed: run last *:update for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency: com.websudos#diesel-engine_2.11;0.3.0: not found
[error] Total time: 2 s, completed 2016-07-11 18:19:22
The latest version of phantom available on Maven Central is 1.27.0. The diesel-engine does not get published to Maven Central at all, instead it gets published to our OSS Bintray repository.
resolvers += Resolver.bintrayRepo("websudos", "oss-releases") is the one you need to get diesel-engine to resolve properly. This is all described on the wiki page on integrating phantom, available here.
There is no such version on maven central. The oldest one is 1.5.0. If you really want to use the old one, try to download it from here adding this line to your sbt:
resolvers += Resolver.bintrayRepo("websudos", "oss-releases")

Why can't sbt resolve OpenIMAJ dependency?

Here is the build.sbt I use in a project:
name := "FaceReg"
version := "1.0"
libraryDependencies += "org.openimaj" % "image-processing" % "1.2.1"
While updateing the project, sbt reports UNRESOLVED DEPENDENCIES:
[info] Resolving org.openimaj#image-processing;1.2.1 ...
[warn] module not found: org.openimaj#image-processing;1.2.1
[warn] ==== local: tried
[warn] /Users/jacek/.ivy2/local/org.openimaj/image-processing/1.2.1/ivys/ivy.xml
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/org/openimaj/image-processing/1.2.1/image-processing-1.2.1.pom
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.openimaj#image-processing;1.2.1: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[trace] Stack trace suppressed: run last *:update for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency: org.openimaj#image-processing;1.2.1: not found
What could be issue? How to solve it?
OpenImaj has its own repository and does not publish artifacts to the maven central (that's one of the few repositories consulted by sbt by default).
Add the following resolvers to build.sbt to have the dependency resolved properly and you will be fine:
resolvers += "OpenIMAJ maven releases repository" at "http://maven.openimaj.org"
resolvers += "OpenIMAJ maven snapshots repository" at "http://snapshots.openimaj.org"
Also, make sure you use only % in artifact, not %% because right now it looks like you're targeting specific Scala version in dependency and it's not what you would want for OpenImaj.

Unresolved dependencies for np 0.2.0 with SBT 0.13?

Scala 2.10.2 and SBT 0.13
I'm trying to use the np plugin and added the following lines to ../0.13/np.sbt:
seq(npSettings:_*)
(NpKeys.defaults in (Compile, NpKeys.np)) ~= {
_.copy(org="me.lessis", version="0.1.0-SNAPSHOT")
}
and this to <home-directory>/.sbt/plugins.sbt
addSbtPlugin("me.lessis" % "np" % "0.2.0")
resolvers += Resolver.url("sbt-plugin-releases",url("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/"))(Resolver.ivyStylePatterns)
When I execute sbt run I am getting :
[info] Updating {file:/home/Projects/helloSbt/}default-310e5b...
[info] Resolving me.lessis#np;0.2.0 ...
[warn] module not found: me.lessis#np;0.2.0
[warn] ==== local: tried
[warn] /home/.ivy2/local/me.lessis/np/scala_2.10/sbt_0.12/0.2.0/ivys/ivy.xml
[warn] ==== sbt-plugin-releases: tried
[warn] http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/me.lessis/np/scala_2.10/sbt_0.12/0.2.0/ivys/ivy.xml
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/me/lessis/np_2.10_0.12/0.2.0/np-0.2.0.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: me.lessis#np;0.2.0: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
[warn] me.lessis:np:0.2.0 (sbtVersion=0.12, scalaVersion=2.10)
[warn]
[trace] Stack trace suppressed: run last *:update for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency: me.lessis#np;0.2.0: not found
[error] Total time: 3 s, completed Feb 6, 2014 9:23:17 AM
What am I doing wrong ?
For scala 2.10 you have to use sbt 0.13. I tried with sbt 0.13
Open in browser link:
http://dl.bintray.com/sbt/sbt-plugin-releases/me.lessis/np/scala_2.10/
There is only:
sbt_0.13/
For scala 2.9.2 you need to use sbt 0.12
==========================
Update:
Remove global configuration from $HOME/.sbt (plugins.sbt). or make or action from fresh user account (new user never used sbt)
Create empty directory test
Go to test
Create directory project
Go to project
Create plugins.sbt with content as above in question
Go to test directory
run sbt test or other command
see output - me.lessis#np;0.2.0 should be downloaded
Use .sbt/0.13/plugins/plugins.sbt (note the 0.13/plugins in the path) or even better for quick scan of the plugins installed, use .sbt/0.13/plugins/np.sbt so it's clear from the file name(s) about the plugins.
Please also note that from the question it appears that you're using SBT 0.12:
me.lessis:np:0.2.0 (sbtVersion=0.12, scalaVersion=2.10)
Add project/build.properties under helloSbt with the following line to have 0.13 be in use:
sbt.version=0.13.1

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.

How to setup IntelliJ + Scala + specs + sbt project?

I am trying to setup an empty sbt project with specs2 for Scala (2.10) with IntelliJ (12.1) support and I am getting this error when I do sbt compile on empty project directory:
% sbt compile
Getting net.java.dev.jna jna 3.2.3 ...
:: retrieving :: org.scala-sbt#boot-jna
confs: [default]
1 artifacts copied, 0 already retrieved (838kB/32ms)
Getting org.scala-sbt sbt_2.9.1 0.11.3 ...
:: retrieving :: org.scala-sbt#boot-app
confs: [default]
37 artifacts copied, 0 already retrieved (7245kB/734ms)
Getting Scala 2.9.1 (for sbt)...
:: retrieving :: org.scala-sbt#boot-scala
confs: [default]
4 artifacts copied, 0 already retrieved (19939kB/402ms)
[info] Loading project definition from /Users/pathikrit/Projects/scalgos/project
[info] Set current project to scalgos (in build file:/Users/pathikrit/Projects/scalgos/)
Getting Scala 2.10.1 ...
:: retrieving :: org.scala-sbt#boot-scala
confs: [default]
5 artifacts copied, 0 already retrieved (24386kB/107ms)
[info] Updating {file:/Users/pathikrit/Projects/scalgos/}default-7d65e1...
[info] Resolving org.scala-lang#scala-library;2.10.1 ...
[info] Resolving org.specs2#specs2_2.10.1;1.14 ...
[warn] module not found: org.specs2#specs2_2.10.1;1.14
[warn] ==== local: tried
[warn] /Users/pathikrit/.ivy2/local/org.specs2/specs2_2.10.1/1.14/ivys/ivy.xml
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/org/specs2/specs2_2.10.1/1.14/specs2_2.10.1-1.14.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.specs2#specs2_2.10.1;1.14: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[error] {file:/Users/pathikrit/Projects/scalgos/}default-7d65e1/*:update: sbt.ResolveException: unresolved dependency: org.specs2#specs2_2.10.1;1.14: not found
[error] Total time: 4 s, completed Mar 25, 2013 5:11:17 PM
My build.sbt file looks like this:
name := "scalgos"
version := "0.0.1"
scalaVersion := "2.10.1"
libraryDependencies += "org.specs2" %% "specs2" % "1.14" % "test"
I installed sbt by doing brew install sbt:
% brew info sbt
sbt: stable 0.12.2, devel 0.13.0-M1
http://www.scala-sbt.org
/usr/local/Cellar/sbt/0.11.3-2 (3 files, 1.1M) *
https://github.com/mxcl/homebrew/commits/master/Library/Formula/sbt.rb
==> Caveats
You can use $SBT_OPTS to pass additional JVM options to SBT.
For convenience, this can specified in `~/.sbtconfig`.
For example:
SBT_OPTS="-XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M"
Brew says I have sbt 0.12 but when I sbt --version I get:
% sbt --version
sbt launcher version 0.11.3-2
I tried to atleast generate the IntelliJ files by putting this in my $PROJECT_DIR/projects/plugins.sbt:
resolvers += "sbt-idea-repo" at "http://mpeltonen.github.com/maven/"
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.2.0")
But when I did sbt gen-idea, I got this error:
% sbt gen-idea
[info] Loading project definition from /Users/pathikrit/Projects/scalgos/project
[info] Set current project to scalgos (in build file:/Users/pathikrit/Projects/scalgos/)
[info] Trying to create an Idea module scalgos
[info] Updating {file:/Users/pathikrit/Projects/scalgos/}default-7d65e1...
[info] Resolving org.scala-lang#scala-library;2.10.1 ...
[info] Resolving org.specs2#specs2_2.10.1;1.14 ...
[warn] module not found: org.specs2#specs2_2.10.1;1.14
[warn] ==== local: tried
[warn] /Users/pathikrit/.ivy2/local/org.specs2/specs2_2.10.1/1.14/ivys/ivy.xml
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/org/specs2/specs2_2.10.1/1.14/specs2_2.10.1-1.14.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.specs2#specs2_2.10.1;1.14: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[error] {file:/Users/pathikrit/Projects/scalgos/}default-7d65e1/*:update: sbt.ResolveException: unresolved dependency: org.specs2#specs2_2.10.1;1.14: not found
[info] Updating {file:/Users/pathikrit/Projects/scalgos/}default-7d65e1...
[info] Resolving org.scala-lang#scala-library;2.10.1 ...
[info] Resolving org.specs2#specs2_2.10.1;1.14 ...
[warn] module not found: org.specs2#specs2_2.10.1;1.14
[warn] ==== local: tried
[warn] /Users/pathikrit/.ivy2/local/org.specs2/specs2_2.10.1/1.14/ivys/ivy.xml
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/org/specs2/specs2_2.10.1/1.14/specs2_2.10.1-1.14.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.specs2#specs2_2.10.1;1.14: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[error] {file:/Users/pathikrit/Projects/scalgos/}default-7d65e1/*:update: sbt.ResolveException: unresolved dependency: org.specs2#specs2_2.10.1;1.14: not found
[error] Failed to obtain dependency classpath
[error] java.lang.IllegalArgumentException
[error] Use 'last' for the full log.
Can someone post a sample build.sbt that would generate IntelliJ 12.1 files for Scala 2.10.1 and sbt?
I checked in my project here: https://github.com/pathikrit/scalgos
Please advise what am I doing wrong???
you can use this project i built that provides what you are looking for out of the box
Skeleton
I'm planning to upgrade the sbt config and latest and greatest libs (sbt-idea 1.3.0 and scala 2.10.1) tonight.
enjoy!
you should update sbt version to 0.12.X, create file "project/build.properties", and put "sbt.version=0.12.1"
i forked your repo and edited the sbt version, it seems work fine on my machine
https://github.com/yuanw/scalgos