Why can't sbt resolve OpenIMAJ dependency? - scala

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.

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")

Fail to upload to sonatype with sbt 0.13 with xsbt-gpg-plugin unresolved dependency: com.jsuereth#xsbt-gpg-plugin;0.6

my plugins.sbt has this:
logLevel := Level.Warn
addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "1.0.0")
resolvers += Resolver.url("sbt-plugin-releases", new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases")) (Resolver.ivyStylePatterns)
addSbtPlugin("com.jsuereth" % "xsbt-gpg-plugin" % "0.6")
when i run sbt publish i get:
[warn] ==== sbt-plugin-releases: tried [warn]
http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/com.jsuereth/xsbt-gpg-plugin/scala_2.10/sbt_0.13/0.6/ivys/ivy.xml
[warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] ::
UNRESOLVED DEPENDENCIES :: [warn]
:::::::::::::::::::::::::::::::::::::::::::::: [warn] ::
com.jsuereth#xsbt-gpg-plugin;0.6: not found [warn]
:::::::::::::::::::::::::::::::::::::::::::::: [warn] [warn] Note:
Some unresolved dependencies have extra attributes. Check that these
dependencies exist with the requested attributes. [warn]
com.jsuereth:xsbt-gpg-plugin:0.6 (sbtVersion=0.13,
scalaVersion=2.10) [warn] sbt.ResolveException: unresolved
dependency: com.jsuereth#xsbt-gpg-plugin;0.6: not found at
sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:217) at
sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:126)
So I tried updating the addSbtPlugin to be:
addSbtPlugin("com.jsuereth" % "xsbt-gpg-plugin" % "0.6",
sbtVersion = "0.12", // SBT version
scalaVersion = "2.9.2" )
Now I get
[warn] The global sbt directory is now versioned and is located at /home//.sbt/0.13.
[warn] You are seeing this warning because there is global configuration in /home//.sbt but not in /home//.sbt/0.13.
[warn] The global sbt directory may be changed via the sbt.global.base system property.
[info] Loading project definition from /home//dev/projects/myproj/project
[warn] Multiple resolvers having different access mechanism configured with same name 'sbt-plugin-releases'. To avoid conflict, Remove duplicate project resolvers (`resolvers`) or rename publishing resolver (`publishTo`).
**java.lang.NoClassDefFoundError: sbt/Scoped$ListSetting**
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
anyway to fix it please?
thanks
Not sure, but I think you use a rather old version of that plugin?
I use the following with latest sbt 0.13.6. I have this globally installed in ~/.sbt/0.13/plugins/build.sbt:
addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.1") // sign Sonatype artifacts
I also left my credentials in ~/.sbt/0.13/sonatype.sbt:
credentials += Credentials("Sonatype Nexus Repository Manager",
"oss.sonatype.org",
"user-name", "pass-word")
This way I can do sbt publish-signed.
Here is the plugin documentation. (As you can see, there is already an even newer version available)

sbt and scct .... module not found: reaktor#sbt-scct;0.2-SNAPSHOT

scala is version 2.10.2 and sbt is 0.13.0
I am trying to setup scct for scala unit test code coverage so in build.sbt
I added
seq(ScctPlugin.instrumentSettings : _*)
and in project/plugins.sbt I added
resolvers += Classpaths.typesafeResolver
resolvers += "scct-github-repository" at "http://mtkopone.github.com/scct/maven-repo"
addSbtPlugin("reaktor" %% "sbt-scct" % "0.2-SNAPSHOT")
I get errors like ....
module not found: reaktor#sbt-scct;0.2-SNAPSHOT
Last message is
[warn] ==== scct-github-repository: tried
[warn] http://mtkopone.github.com/scct/maven-repo/reaktor/sbt-scct_2.10_0.13/0.2-SNAPSHOT/sbt-scct-0.2-SNAPSHOT.pom
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: reaktor#sbt-scct;0.2-SNAPSHOT: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
[warn] reaktor:sbt-scct:0.2-SNAPSHOT (sbtVersion=0.13, scalaVersion=2.10)
I look in http://mtkopone.github.io/scct/maven-repo/reaktor/
and I see the one I seem to need is missing e.g. I see
sbt-scct_2.9.2_0.13/
scct_2.10/
and a bunch of others but no ... sbt-scct_2.10_0.13
Can you help ? (I am a sbt newbie)
SCCT has a new source code repository: https://github.com/SCCT/scct
As a result you can fetch a release version from maven central with addSbtPlugin("com.github.scct" %% "sbt-scct" % "0.2") in your plugins.sbt file.
My project to reproduce is on GitHub.
Update:
The repository has been relocated at https://github.com/sqality/scct
and you need addSbtPlugin("com.sqality.scct" % "sbt-scct" % "version") in your plugins.sbt file.
The original SCCT is inactive now.
Here are the two most active forks.
http://github.com/sqality
http://github.com/scoverage

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.

SBT not resolving Squeryl dependency

I recently started a new project with the Play! Framework and Scala.
I'm used to using Squeryl for my ORM, but for some reason it cannot resolve my dependency this time (Although it will resolve others, just not squeryl).
The only thing I'm doing differently is that I'm on a different computer than I was before (Windows now, Arch before) and I'm using Play 2.1.1 instead of 2.1.
EDIT: I am also behind a proxy, I thought this may have been resolved since I can resolve some dependencies, but I can't see any other reason than the proxy is screwing with sbt. I can see the maven repo for squeryl in my browser, but sbt fails to find it.
build.properties:
sbt.version=0.12.2
Build.scala:
val appDependencies = Seq(
// Add your project dependencies here,
jdbc,
"org.squeryl" %% "squeryl" % "0.9.5-6"
)
plugins.sbt:
// Comment to get more information during initialization
logLevel := Level.Warn
// The Typesafe repository
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
// Use the Play sbt plugin for Play projects
addSbtPlugin("play" % "sbt-plugin" % "2.1.1")
Console:
C:\Path\To\Play\APP>play run
[info] Loading project definition from C:\Path\To\Play\APP
....
[warn] module not found: org.squeryl#squeryl_2.10;0.9.5-6
[warn] ==== local: tried
[warn] C:\Path\To\Play\play-2.1.1\repository\local\org.squeryl\squeryl_2.10
[warn] ==== Typesafe Releases Repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/org/squeryl/squeryl_2.10/0.9.5-6/squeryl_2.10-0.9.5-6.po
[warn] ==== Typesafe Snapshots Repository: tried
[warn] http://repo.typesafe.com/typesafe/snapshots/org/squeryl/squeryl_2.10/0.9.5-6/squeryl_2.10-0.9.5-6.p
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/org/squeryl/squeryl_2.10/0.9.5-6/squeryl_2.10-0.9.5-6.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.squeryl#squeryl_2.10;0.9.5-6: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: unresolved dependency: org.squeryl#squeryl_2.10;0.9.5-6: not found
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:214)
at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:122)
...
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
[error] (*:update) sbt.ResolveException: unresolved dependency: org.squeryl#squeryl_2.10;0.9.5-6: not found
[warn] some of the dependencies were not recompiled properly, so classloader is not avaialable
[info] Updating {file:/C:/Path/To/Play/APP}
[warn] module not found: org.squeryl#squeryl_2.10;0.9.5-6
[warn] ==== local: tried
[warn] C:\Path\To\Play\play-2.1.1\repository\local\org.squeryl\squeryl_2.10
[warn] ==== Typesafe Releases Repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/org/squeryl/squeryl_2.10/0.9.5-6/squeryl_2.10-0.9.5-6.po
[warn] ==== Typesafe Snapshots Repository: tried
[warn] http://repo.typesafe.com/typesafe/snapshots/org/squeryl/squeryl_2.10/0.9.5-6/squeryl_2.10-0.9.5-6.p
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/org/squeryl/squeryl_2.10/0.9.5-6/squeryl_2.10-0.9.5-6.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.squeryl#squeryl_2.10;0.9.5-6: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: unresolved dependency: org.squeryl#squeryl_2.10;0.9.5-6: not found
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:214)
.....
at java.lang.Thread.run(Unknown Source)
[error] (*:update) sbt.ResolveException: unresolved dependency: org.squeryl#squeryl_2.10;0.9.5-6: not found
When you see http://repo1.maven.org/maven2/org/squeryl/
you will get solution.
PROJECT/project/Build.scala
val appDependencies = Seq(
// Add your project dependencies here,
jdbc,
anorm,
"org.squeryl" % "squeryl_2.10" % "0.9.5-6"
)
This is from my build.sbt (well, a relevant section) - what scala version?
scalaVersion := "2.10.1"
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases"
libraryDependencies ++= Seq(
"org.squeryl" %% "squeryl" % "0.9.5-6",
To be sure that it's not a potential SBT project's configuration issue, don't use for now the %% notation. Indeed, this one automatically chooses the Jar version corresponding to your current scala version, which may be different than the one you expect (oversight in your conf, conflict of variables in some configuration files etc...).
Prefer this in order to isolate your "error" context:
libraryDependencies += "org.squeryl" % "squeryl" % "0.9.5-6"
It ended up being an issue with my proxy at work, it was setup wrong and had to correct it. All is well now!