Following simple SBT fails to import org.lwjglx / lwjgl3-awt:
name := "LWJGLTest"
version := "0.1"
scalaVersion := "2.12.8"
libraryDependencies += "org.lwjglx" % "lwjgl3-awt" % "0.1.5"
The error is:
[warn] Detected merged artifact: [FAILED ] org.lwjgl#lwjgl-opengl;3.2.2!lwjgl-opengl.jar: (0ms).
[warn] Detected merged artifact: [FAILED ] org.lwjgl#lwjgl;3.2.2!lwjgl.jar: (0ms).
[warn] ==== public: tried
[warn] ==== public: tried
[warn] https://repo1.maven.org/maven2/org/lwjgl/lwjgl-opengl/3.2.2/lwjgl-opengl-3.2.2-natives-${platform}.jar
[warn] https://repo1.maven.org/maven2/org/lwjgl/lwjgl/3.2.2/lwjgl-3.2.2-natives-${platform}.jar
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: FAILED DOWNLOADS ::
[warn] :: ^ see resolution messages for details ^ ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.lwjgl#lwjgl;3.2.2!lwjgl.jar
[warn] :: org.lwjgl#lwjgl-opengl;3.2.2!lwjgl-opengl.jar
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[error] sbt.librarymanagement.ResolveException: download failed: org.lwjgl#lwjgl;3.2.2!lwjgl.jar
[error] download failed: org.lwjgl#lwjgl-opengl;3.2.2!lwjgl-opengl.jar
Is this an issue with SBT, or with the lwjgl3-awt artifact? Is there some way how to work around it?
For a comparison, following sbt loads fine:
name := "LWJGLTest"
version := "0.1"
scalaVersion := "2.12.8"
libraryDependencies += "org.lwjgl" % "lwjgl" % "3.2.2"
libraryDependencies += "org.lwjgl" % "lwjgl-opengl" % "3.2.2"
Following workaround allows to proceed by specifying the necessary dependencies manually:
libraryDependencies += "org.lwjgl" % "lwjgl" % "3.2.2"
libraryDependencies += "org.lwjgl" % "lwjgl-opengl" % "3.2.2"
libraryDependencies += "org.lwjglx" % "lwjgl3-awt" % "0.1.5" excludeAll ExclusionRule("org.lwjgl")
I think the problem is SBT somehow does not understand the ${platform} in the pom.xml. The solution above prevents it trying to resolve those dependencies, which is why they are provided explicitly.
Related
I'm starting a new project to try out Scala Cats, and my SBT seems to refuse to find the cats-core. It has no trouble bringing in something like ScalaTest, but whenever I try to refresh my sbt project with the cats-core as a libraryDependencies, it claims it is an unresolved dependency, looking into the error, it says:
[warn] module not found: org.typelevel#cats-core_2.13;2.0.0-M2
[warn] ==== local: tried
[warn] /Users/me/.ivy2/local/org.typelevel/cats-core_2.13/2.0.0-M2/ivys/ivy.xml
[warn] ==== public: tried
[warn] https://repo1.maven.org/maven2/org/typelevel/cats-core_2.13/2.0.0-M2/cats-core_2.13-2.0.0-M2.pom
[warn] ==== local-preloaded-ivy: tried
[warn] /Users/me/.sbt/preloaded/org.typelevel/cats-core_2.13/2.0.0-M2/ivys/ivy.xml
[warn] ==== local-preloaded: tried
[warn] file:////Users/me/.sbt/preloaded/org/typelevel/cats-core_2.13/2.0.0-M2/cats-core_2.13-2.0.0-M2.pom
[warn] ==== cats-core: tried
[warn] https://mvnrepository.com/artifact/org.typelevel/cats-core/org/typelevel/cats-core_2.13/2.0.0-M2/cats-core_2.13-2.0.0-M2.pom
My build.sbt looks like this:
scalaVersion := "2.13.0"
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-core" % "2.0.0-M2",
"org.scalatest" %% "scalatest" % "3.0.8" % Test
)
resolvers += "cats-core" at "https://mvnrepository.com/artifact/org.typelevel/cats-core" // it gives the same errors without this line
scalacOptions ++= Seq("-Xfatal-warnings","-Ypartial-unification")
val exportFullResolvers = taskKey[Unit]("debug resolvers")
exportFullResolvers := {
for {
(resolver,idx) <- fullResolvers.value.zipWithIndex
} println(s"${idx}. ${resolver.name}")
}
Any idea how to bring it in?
The error is pretty explicit module not found: org.typelevel#cats-core_2.13;2.0.0-M2
What I do is then just search (google) for mavenrepo cats-core
Usually the top result will lead you to
https://mvnrepository.com/artifact/org.typelevel/cats-core
Or on on (sometimes this site is easier, when navigating scala versions):
https://index.scala-lang.org/typelevel/cats/cats-core
I am trying to add a dependency to json4, but I get a module not found error. I am using scala-version 2.12.4 and sbt-version 1.1.1. My other dependency additions seem to add in a normal way.
Here is my code in build.sbt:
scalaVersion := "2.12.4"
libraryDependencies += "io.spray" %% "spray-json" % "1.3.4"
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.4" % Test
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.13.4" % Test
libraryDependencies += "org.json4s" %% "json4s-native" % "3.3.0"
This is the error message that I get:
[warn] module not found: org.json4s#json4s-native_2.12;3.3.0
[warn] ==== local: tried
[warn] /Users/*****/.ivy2/local/org.json4s/json4s-native_2.12/3.3.0/ivys/ivy.xml
[warn] ==== public: tried
[warn] https://repo1.maven.org/maven2/org/json4s/json4s-native_2.12/3.3.0/ json4s-native_2.12-3.3.0.pom
[warn] ==== local-preloaded-ivy: tried
[warn] /Users/*****/.sbt/preloaded/org.json4s/json4s-native_2.12/3.3.0/ivys/ivy.xml
[warn] ==== local-preloaded: tried
[warn] file:////Users/*****/.sbt/preloaded/org/json4s/json4s-native_2.12/3.3.0/ json4s-native_2.12-3.3.0.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.json4s#json4s-native_2.12;3.3.0: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
Help appreciated, thanks!
You need to use a newer version of this library.
Try this:
libraryDependencies += "org.json4s" %% "json4s-native" % "3.6.0-M3"
or some earlier version but not 3.3.0
Link to versions:
http://search.maven.org/#search%7Cga%7C2%7Cg%3A%22org.json4s%22
Edit: This problem is with compatibility. You use a new version of Scala and sbt. Previous version of this library are not compatible with this Scala version or sbt version.
I have a Scala app developed using IntelliJ.
When I try to package it using sbt, I get the following error and it complains about the sqljdbc4 which I have included in my build.sbt file.
> package
[info] Updating {file:/C:/Users/jthomas1/IdeaProjects/AvroToParquet/}avrotoparquet...
[info] Resolving com.microsoft.sqlserver#sqljdbc4;4.0 ...
[warn] module not found: com.microsoft.sqlserver#sqljdbc4;4.0
[warn] ==== local: tried
[warn] C:\Users\jthomas1\.ivy2\local\com.microsoft.sqlserver\sqljdbc4\4.0\ivys\ivy.xml
[warn] ==== public: tried
[warn] https://repo1.maven.org/maven2/com/microsoft/sqlserver/sqljdbc4/4.0/sqljdbc4-4.0.pom
[warn] ==== local-preloaded-ivy: tried
[warn] C:\Users\jthomas1\.sbt\preloaded\com.microsoft.sqlserver\sqljdbc4\4.0\ivys\ivy.xml
[warn] ==== local-preloaded: tried
[warn] file:/C:/Users/jthomas1/.sbt/preloaded/com/microsoft/sqlserver/sqljdbc4/4.0/sqljdbc4-4.0.pom
[info] Resolving jline#jline;2.11 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.microsoft.sqlserver#sqljdbc4;4.0: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Unresolved dependencies path:
[warn] com.microsoft.sqlserver:sqljdbc4:4.0 (C:\Users\jthomas1\IdeaProjects\AvroToParquet\build.sbt#L13-14)
[warn] +- default:avrotoparquet_2.11:0.1
[trace] Stack trace suppressed: run last *:update for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency: com.microsoft.sqlserver#sqljdbc4;4.0: not found
[error] Total time: 4 s, completed Nov 2, 2017 5:18:51 PM
Following from by build.sbt file
name := "AvroToParquet"
version := "0.1"
scalaVersion := "2.11.1"
libraryDependencies += "com.microsoft.sqlserver"
% "sqljdbc4" % "4.0"
% "runtime"
libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-core" % "1.6.1",
"org.apache.spark" %% "spark-sql" % "1.6.1",
"org.apache.spark" %% "spark-hive" % "1.6.1"
)
Appreciate your help!
You can add
resolvers += "Clojars" at "http://clojars.org/repo/"
to your build.sbt and it should solve the problem.
Note, that there are similar questions already and in the answers people write
Unfortunately Microsoft doesn't make this artifact available via any maven repository. You need to download the jar from the Microsoft website, and then manually install it into your local maven repository.
So if you don't want to use Clojars repository from above, you can just download this jar from Microsoft and place it in the lib/ folder in your sbt project.
Also see this answer which refers to another artifact for this driver available in Maven Central.
A Microsoft Sql Server JDBC is listed in maven central here.
There is a tab on that page listing sbt info for this jar:
libraryDependencies += "com.microsoft.sqlserver" % "mssql-jdbc" % "7.4.1.jre12"
I have a simple Scala application built using spray.io. I am using Scala 2.11.2 and SBT 0.13.0. All of my dependencies are listed here:
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % "2.3.6",
"com.typesafe.akka" %% "akka-slf4j" % "2.3.6",
"io.spray" % "spray-can_2.11" % "1.3.2",
"io.spray" % "spray-routing_2.11" % "1.3.2",
"io.spray" % "spray-json_2.11" % "1.3.1"
)
libraryDependencies += "org.mongodb" %% "casbah" % "2.7.2"
libraryDependencies += "com.stormpath.sdk" % "stormpath-sdk-api" % "1.0.RC4.2"
libraryDependencies += "com.stormpath.sdk" % "stormpath-sdk-httpclient" % "1.0.RC4.2"
While building and running it locally everything is fine but when i try to push / deploy it to PaaS platforms like cloudControl or heroku i am getting below dependency issue:
[info] Resolving org.apache.httpcomponents#httpclient;${httpclient.version} ...
[warn] module not found: org.apache.httpcomponents#httpclient;${httpclient.version}
[warn] ==== local: tried
[warn] /tmp/scala_buildpack_build_dir/.sbt_home/.ivy2/local/org.apache.httpcomponents/httpclient/${httpclient.version}/ivys/ivy.xml
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/org/apache/httpcomponents/httpclient/${httpclient.version}/httpclient-${httpclient.version}.pom
[warn] ==== spray repo: tried
[warn] http://repo.spray.io/org/apache/httpcomponents/httpclient/${httpclient.version}/httpclient-${httpclient.version}.pom
[warn] ==== spray nightlies: tried
[warn] http://nightlies.spray.io/org/apache/httpcomponents/httpclient/${httpclient.version}/httpclient-${httpclient.version}.pom
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/org/apache/httpcomponents/httpclient/${httpclient.version}/httpclient-${httpclient.version}.pom
...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.apache.httpcomponents#httpclient;${httpclient.version}: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: FAILED DOWNLOADS ::
[warn] :: ^ see resolution messages for details ^ ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.stormpath.sdk#stormpath-sdk-api;1.0.RC4.2!stormpath-sdk-api.jar
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: unresolved dependency: org.apache.httpcomponents#httpclient;${httpclient.version}: not found
...
[error] (*:update) sbt.ResolveException: unresolved dependency: org.apache.httpcomponents#httpclient;${httpclient.version}: not found
[error] download failed: com.stormpath.sdk#stormpath-sdk-api;1.0.RC4.2!stormpath-sdk-api.jar
[error] Total time: 59 s, completed May 4, 2015 1:05:37 PM
Inspecting my dependencies using sbt-dependency-graph shows me that not resolved org.apache.httpcomponents:httpclient is a nested dependency of com.stormpath.sdk:stormpath-sdk-httpclient:1.0.RC4.2.
For some reason variable ${httpclient.version} is not resolved during built - but that is all I can figure it out here. Please help!!!
I am not sure what is going on. But excluding the transitive dependency and adding it to SBT explicitily seems to fix the problem, at least the unresolved dependency problem:
libraryDependencies += "com.stormpath.sdk" % "stormpath-sdk-httpclient" % "1.0.RC4.2" exclude("org.apache.httpcomponents","httpclient")
libraryDependencies += "org.apache.httpcomponents" % "httpclient" % "4.2.2"
But keep in mind that we don't really know which version of apache's httpclient stormpath-sdk-httpclient used in its compilation, so you might run into runtime classpath/linking related exceptions. If that happens I recommend asking the developers of stormpath-sdk-httpclient.
EDIT:
you can see the version they used at:
https://github.com/stormpath/stormpath-sdk-java/blob/master/pom.xml#L98
I'm trying to build a Scala jar file to run it in spark.
I'm following this tutorial.
when trying to build jar file using sbt as here, i'm facing with following error
[info] Resolving org.apache.spark#spark-core_2.10.4;1.0.2 ...
[warn] module not found: org.apache.spark#spark-core_2.10.4;1.0.2
[warn] ==== local: tried
[warn] /home/hduser/.ivy2/local/org.apache.spark/spark-core_2.10.4/1.0.2/ivys/ivy.xml
[warn] ==== Akka Repository: tried
[warn] http://repo.akka.io/releases/org/apache/spark/spark-core_2.10.4/1.0.2/spark-core_2.10.4-1.0.2.pom
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/org/apache/spark/spark-core_2.10.4/1.0.2/spark-core_2.10.4-1.0.2.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.apache.spark#spark-core_2.10.4;1.0.2: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[error] {file:/home/prithvi/scala/asd/}default-d57abf/*:update: sbt.ResolveException: unresolved dependency: org.apache.spark#spark-core_2.10.4;1.0.2: not found
[error] Total time: 2 s, completed 13 Aug, 2014 5:24:24 PM
what's the issue and how to solve it.
Dependency issue has been resolved. Thank you "om-nom-nom"but new error arised
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: FAILED DOWNLOADS ::
[warn] :: ^ see resolution messages for details ^ ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.eclipse.jetty.orbit#javax.transaction;1.1.1.v201105210645!javax.transaction.orbit
[warn] :: org.eclipse.jetty.orbit#javax.servlet;3.0.0.v201112011016!javax.servlet.orbit
[warn] :: org.eclipse.jetty.orbit#javax.mail.glassfish;1.4.1.v201005082020!javax.mail.glassfish.orbit
[warn] :: org.eclipse.jetty.orbit#javax.activation;1.1.0.v201105071233!javax.activation.orbit
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[error] {file:/home/prithvi/scala/asd/}default-c011e4/*:update: sbt.ResolveException: download failed: org.eclipse.jetty.orbit#javax.transaction;1.1.1.v201105210645!javax.transaction.orbit
[error] download failed: org.eclipse.jetty.orbit#javax.servlet;3.0.0.v201112011016!javax.servlet.orbit
[error] download failed: org.eclipse.jetty.orbit#javax.mail.glassfish;1.4.1.v201005082020!javax.mail.glassfish.orbit
[error] download failed: org.eclipse.jetty.orbit#javax.activation;1.1.0.v201105071233!javax.activation.orbit
[error] Total time: 855 s, completed 14 Aug, 2014 12:28:33 PM
You have your dependency defined as
"org.apache.spark" %% "spark-core" % "1.0.2"
That %% instructs sbt to substitute current scala version to artifact name. Apparently, spark was build for the whole family of 2.10 scala, without specific jars for 2.10.1, 2.10.2 ...
So all you have to do is to redefine it as:
"org.apache.spark" % "spark-core_2.10" % "1.0.2"
I had the same issue.
Looks like that some bugs are in different versions/compilations/etc.
For me the following build.sbt worked fine
name := "My Project"
version := "1.0"
scalaVersion := "2.11.8"
libraryDependencies += "org.apache.spark" %% "spark-sql" % "2.3.2"
Hope it helps
spark-core_2.10.4;1.0.2 means that it is build on top of scala 2.10 vesion.
so you have to specified this scalaVersion := "2.10.4" in your build file.
Please check your .sbt file and change accordingly.
libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-core" % "1.1.0",
"org.eclipse.jetty.orbit" % "javax.servlet" % "3.0.0.v201112011016",
"org.eclipse.jetty.orbit" % "javax.transaction" % "1.1.1.v201105210645",
"org.eclipse.jetty.orbit" % "javax.mail.glassfish" % "1.4.1.v201005082020"
)
How can you change the current dependencies? I mean, when you type sbt package for a build file like:
name := "Simple Project"
version := "1.0"
scalaVersion := "2.10.4"
libraryDependencies += "org.apache.spark" %% "spark-core" % "1.2.0"
SBT will start resolving and downloading all kinds of dependencies. But if you see that it is failing on a dependency that is no longer inthe maven repo, what to do? Where can you change the dpencies it tries.
#OP: The problem is that your SBT is outdated. If you downloaded it using apt, you can use apt to remove it as well. In any case, download the latest .tgz (not the .deb) and simply unpack it, after that add the /sbt/bin/ folder to your .bashrc I noticed that older SBT's (the .deb and apt-get versions) work with older scala versions. You either need to manually add or change the dependencies that the older SBT is trying to find or simply change to the latest (not sooo)SBT.