I'm moving my app from RUN#Cloud to Heroku. I try to deploy the app to Heroku using sbt-heroku plugin. The dependency doesn't want to resolve.
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.heroku#sbt-heroku;0.1.5: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
sbt version is 0.13.1. The content of Build.scala file:
object ApplicationBuild extends Build {
val appName = "happymelly-teller"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
jdbc,
cache,
filters,
"be.objectify" %% "deadbolt-scala" % "2.2-RC2",
"com.andersen-gott" %% "scravatar" % "1.0.3",
"com.github.tototoshi" %% "slick-joda-mapper" % "0.4.0",
"com.typesafe.play" %% "play-slick" % "0.5.0.8",
"com.heroku" % "sbt-heroku" % "0.1.5",
//"com.typesafe.slick" %% "slick" % "1.0.1",
"mysql" % "mysql-connector-java" % "5.1.27",
"org.apache.poi" % "poi" % "3.9",
"org.apache.poi" % "poi-ooxml" % "3.9",
"org.joda" % "joda-money" % "0.9",
"org.pegdown" % "pegdown" % "1.4.2",
"org.planet42" %% "laika-core" % "0.5.0",
"org.jsoup" % "jsoup" % "1.7.3",
// update selenium to avoid browser test to hang
"org.seleniumhq.selenium" % "selenium-java" % "2.39.0",
"ws.securesocial" %% "securesocial" % "2.1.3",
"nl.rhinofly" %% "play-s3" % "3.3.3"
)
val main = play.Project(appName, appVersion, appDependencies).settings(scalariformSettings: _*).settings(
resolvers += Resolver.url("heroku-sbt-plugin-releases", url("https://dl.bintray.com/heroku/sbt-plugins/"))(Resolver.ivyStylePatterns),
resolvers += Resolver.url("sbt-plugin-releases", url("http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/"))(Resolver.ivyStylePatterns),
resolvers += Resolver.url("Objectify Play Snapshot Repository", url("http://schaloner.github.com/snapshots/"))(Resolver.ivyStylePatterns),
resolvers += Resolver.url("Objectify Play Repository", url("http://schaloner.github.com/releases/"))(Resolver.ivyStylePatterns),
resolvers += "Rhinofly Internal Repository" at "http://maven-repository.rhinofly.net:8081/artifactory/libs-release-local",
resolvers += Resolver.sonatypeRepo("releases"),
routesImport += "binders._"
).settings(
/* Scalariform: override default settings - no spaces within pattern binders is the only option in IntelliJ IDEA,
preserve spaces before arguments is needed for infix function syntax (unconfirmed).*/
ScalariformKeys.preferences := FormattingPreferences().
setPreference(SpacesWithinPatternBinders, false).
setPreference(RewriteArrowSymbols, true).
setPreference(PreserveSpaceBeforeArguments, true)
// Avoid building Scaladocs and sources to reduce build time.
).settings(sources in(Compile, doc) := Seq.empty
).settings(publishArtifact in(Compile, packageDoc) := false
).settings(publishArtifact in(Compile, packageSrc) := false)
}
I tried several versions of the plugin (not only 0.1.5, but 0.1.4 and 0.1.3 also) without any success. Did anyone have this issue?
Try
"com.heroku" %% "sbt-heroku" % "0.1.5"
also, you should have added the following lines to your plugins/plugins.sbt file
resolvers += Resolver.url("heroku-sbt-plugin-releases",
url("https://dl.bintray.com/heroku/sbt-plugins/"))(Resolver.ivyStylePatterns)
addSbtPlugin("com.heroku" % "sbt-heroku" % "0.1.5")
Related
Sorry I am fairly new to Scala and SBT. Here is my build.sbt file
name := "test_stream"
version := "0.1"
scalaVersion := "2.12.10"
resolvers in ThisBuild += Resolver.bintrayRepo("streetcontxt", "maven")
mainClass in Compile := Some("basepackage.Main")
enablePlugins(JavaAppPackaging)
enablePlugins(DockerPlugin)
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-stream" % "2.6.1",
"com.amazonaws" % "aws-java-sdk-s3" % "1.11.693",
"com.streetcontxt" %% "kcl-akka-stream" % "2.0.3",
"me.maciejb.snappyflows" %% "snappy-flows" % "0.2.0",
"org.xerial.snappy" % "snappy-java" % "1.1.7.3",
"org.apache.hadoop" % "hadoop-common" % "2.10.0",
"org.apache.hadoop" % "hadoop-core" % "1.2.1"
)
And I get the following error:
sbt.librarymanagement.ResolveException: unresolved dependency: org.apache.hadoop#hadoop-common;2.10.0: Resolution failed several times for dependency: org.apache.hadoop#hadoop-common;2.10.0 {compile=[default(compile)]}::
try removing ~/.sbt and ~/.ivy2 and run again
I am trying to follow along this tutorial and I can't get reactivemongo to work:
This is my error:
UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.reactivemongo#play2-reactivemongo_2.12;0.11.7.play24: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Unresolved dependencies path:
[warn] org.reactivemongo:play2-reactivemongo_2.12:0.11.7.play24 (/Users/jwan/Desktop/programming/scala_play/rest-api/build.sbt#L12-20)
This is my built.sbt:
name := """rest-api"""
organization := "com.example"
version := "1.0-SNAPSHOT"
lazy val root = (project in file(".")).enablePlugins(PlayScala)
scalaVersion := "2.12.4"
libraryDependencies += guice
libraryDependencies += "org.scalatestplus.play" %% "scalatestplus-play" % "3.1.2" % Test
libraryDependencies ++= Seq(
jdbc,
cache,
ws,
specs2 % Test,
"org.reactivemongo" %% "play2-reactivemongo" % "0.11.7.play24",
"org.scalatest" % "scalatest_2.11" % "2.2.4" % "test"
)
// Adds additional packages into Twirl
//TwirlKeys.templateImports += "com.example.controllers._"
// Adds additional packages into conf/routes
// play.sbt.routes.RoutesKeys.routesImport += "com.example.binders._"
And this is my application.conf:
# https://www.playframework.com/documentation/latest/Configuration
play.modules.enabled += "play.modules.reactivemongo.ReactiveMongoModule"
mongodb.uri = "mongodb://localhost:27017/getting-started-play-scala"
I can't get sbt run to work. Any ideas?
According to https://mvnrepository.com/artifact/org.reactivemongo/play2-reactivemongo.
Required scala version is 2.11 for reactivemongo 0.11.7.play24.
Try 0.13.0-play26 for scalaVersion := "2.12.4" and play 26.
libraryDependencies += "org.reactivemongo" %% "play2-reactivemongo" % "0.13.0-play26"
I mentioned json4s-native 3.3.0 but it refering 3.3.0-SNAPSHOT.
In my project there is 3 modules (common, read and write) each have its scala.sbt.
Before change:
"org.json4s" %% "json4s-native" % Versions.Json4s % "compile",
After change:(Changed all the places in 3 modules)
"org.json4s" %% "json4s-native" % "3.3.0" % "compile",
I run:
sbt
clean
update
Error:
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.json4s#json4s-native_2.10;3.3.0-SNAPSHOT: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Unresolved dependencies path:
[warn] org.json4s:json4s-native_2.10:3.3.0-SNAPSHOT
My Sales buld.sbt is this:
name := "myapp-sales"
organization in ThisBuild := "com.mycompany"
scalaVersion in ThisBuild := "2.11.7"
//crossScalaVersions in Thisq
//Build := List("2.10.5", scalaVersion.value)
//crossPaths := false
scalacOptions in Compile in ThisBuild ++= Seq("-unchecked", "-deprecation", "-encoding", "utf8", "-language:postfixOps", "-language:implicitConVersions")
lazy val common = Project("myapp-sales-common", file("common"))
lazy val read = Project("myapp-sales-read", file("read")).configs(IntegrationTest).settings(Defaults.itSettings: _*).dependsOn(common, write)
lazy val write = Project("myapp-sales-write", file("write")).configs(IntegrationTest).settings(Defaults.itSettings: _*).dependsOn(common)
conflictWarning in ThisBuild := ConflictWarning.disable
parallelExecution in Test in ThisBuild := false
parallelExecution in IntegrationTest in ThisBuild := false
javacOptions in Compile in ThisBuild ++= Seq("-source", "1.6", "-target", "1.6")
//Remove SNAPSHOT check from the release process (for now until Squants gets a release)
releaseProcess := releaseProcess.value.filterNot(_ == ReleaseTransformations.checkSnapshotDependencies)
My read module build.sbt:
libraryDependencies ++= Seq(
"com.mycompany" %% "myapp-core-read" % myappsales.CoreVersion % "compile", // disable using the Scala version in output paths and artifacts,
"com.mycompany" %% "myapp-core-write" % myappsales.CoreVersion % "compile",
"com.mycompany" %% "myapp-registration-common" % myappsales.RegistrationVersion % "compile",
"com.mycompany" %% "myapp-load-common" % myappsales.LoadVersion % "compile",
"com.mycompany" %% "myapp-core-write-test" % myappsales.CoreVersion % "it, test",
"com.mycompany" %% "myapp-core-test" % myappsales.CoreVersion % "it, test"
)
libraryDependencies ++= Seq(
"com.typesafe" % "config" % myappsales.TypeSafeConfigVersion % "compile",
"org.json4s" %% "json4s-native" % Versions.Json4s % "compile",
"io.spray" % "spray-routing" % Versions.Spray % "compile",
"com.typesafe.akka" %% "akka-actor" % Versions.Akka % "compile",
"com.typesafe.akka" %% "akka-remote" % Versions.Akka % "compile"
exclude ("io.netty", "netty")
)
//Assemby settings
test in assembly := {}
assemblyShadeRules in assembly := Seq(
ShadeRule.rename("play.api.libs.iteratee.**" -> "shade.play.api.libs.iteratee.#1")
.inLibrary("play" % "play-iteratees_2.10" % "2.1-RC2")
.inLibrary("org.reactivemongo" % "reactivemongo_2.10" % "0.8.1-SNAPSHOT"),
ShadeRule.rename("scala.concurrent.stm.**" -> "shade.scala.concurrent.stm.#1")
.inLibrary("org.scala-stm" % "scala-stm_2.10.0" % "0.6")
.inLibrary("play" % "play-iteratees_2.10" % "2.1-RC2")
)
assemblyMergeStrategy in assembly := {
case "application.conf" => MergeStrategy.concat
case path => MergeStrategy.defaultMergeStrategy(path)
}
//Make assembly a publishable artifact
artifact in (
Compile, assembly) := {
val art = (artifact in (Compile, assembly)).value
art.copy(`classifier` = Some("assembly"))
}
addArtifact(artifact in (Compile, assembly), assembly)
Why it still looking for SNAPSHOT version?
There's a fairly standard way of investigating this kind of problems. In your plugins.sbt
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.8.2")
Then go sbt dependencyBrowseGraph, this will open your browser and take you to a page where the entire graph of your dependencies including the evicted one can be browsed. Now figure out where the SNAPSHOT is coming from and get rid of it with an exclusion.
I would like to use the phantom cassandra wrapper in my scala project, but when I try to update my sbt build I get a dependency error.
My build.sbt:
version := "1.0"
scalaVersion := "2.11.2"
seq(lsSettings :_*)
libraryDependencies ++= Seq(
"org.clapper" %% "grizzled-scala" % "1.2",
"commons-io" % "commons-io" % "2.4",
"org.rauschig" % "jarchivelib" % "0.6.0",
"com.google.code.findbugs" % "jsr305" % "3.0.0",
"org.scalatest" % "scalatest_2.11" % "2.2.0" % "test",
"com.github.nscala-time" %% "nscala-time" % "1.2.0",
"org.json4s" %% "json4s-native" % "3.2.10",
"org.scala-lang" % "scala-library" % "2.11.2",
"com.websudos" % "phantom-dsl_2.10" % "1.2.0"
)
resolvers += "grizzled-scala-resolver-0" at "https://oss.sonatype.org/content/repositories/releases"
resolvers += "Typesafe repository releases" at "http://repo.typesafe.com/typesafe/releases/"
I get the following error:
[warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
[warn] com.typesafe.sbt:sbt-pgp:0.8.1 (sbtVersion=0.13, scalaVersion=2.10)
Don't know what I have to do...
edit:
Answer from https://github.com/websudosuk/phantom/issues/119
error is on the pom side, new version 1.2.1 coming soon...
Answer from https://github.com/websudosuk/phantom/issues/119
error is on the pom side, new version 1.2.1 coming soon...
I am following the steps for sbt 0.10 on the Assembla Lift wiki and get the following error:
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.github.mpeltonen#sbt-idea_2.8.1;0.10.0-SNAPSHOT: not found
[warn] :: com.github.siasia#xsbt-web-plugin_2.8.1;0.10.1: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[info]
probably because both pages:
http://siasia.github.com/maven2
and
http://mpeltonen.github.com/maven/
don't exist?
My build.sbt:
name := "MyWeb"
scalaVersion := "2.9.0"
seq(WebPlugin.webSettings: _*)
resolvers += "Web plugin repo" at "http://siasia.github.com/maven2"
resolvers += "Web plugin repo2" at "http://mpeltonen.github.com/maven/"
libraryDependencies ++= {
val liftVersion = "2.4-M1"
Seq(
"net.liftweb" %% "lift-webkit" % liftVersion % "compile->default",
"net.liftweb" %% "lift-mapper" % liftVersion % "compile->default",
"net.liftweb" %% "lift-wizard" % liftVersion % "compile->default"
)
}
libraryDependencies ++= Seq(
"junit" % "junit" % "4.5" % "test->default",
"org.mortbay.jetty" % "jetty" % "6.1.22" % "jetty",
"javax.servlet" % "servlet-api" % "2.5" % "provided->default",
"com.h2database" % "h2" % "1.2.138",
"ch.qos.logback" % "logback-classic" % "0.9.26" % "compile->default"
)
and plugins/build.sbt:
resolvers += "Web plugin repo" at "http://siasia.github.com/maven2"
libraryDependencies <+= sbtVersion("com.github.siasia" %% "xsbt-web-plugin" % _)
What am I doing wrong?
This link might helpful.
https://github.com/siasia/xsbt-web-plugin
Replace contents of project/plugins/build.sbt like below
resolvers ++= Seq(
"Web plugin repo" at "http://siasia.github.com/maven2",
Resolver.url("Typesafe repository", new java.net.URL("http://typesafe.artifactoryonline.com/typesafe/ivy-releases/"))(Resolver.defaultIvyPatterns)
)
//Following means libraryDependencies += "com.github.siasia" %% "xsbt-web-plugin" % "0.1.0-<sbt version>""
libraryDependencies <+= sbtVersion(v => "com.github.siasia" %% "xsbt-web-plugin" % ("0.1.0-"+v))
and replace seq(WebPlugin.webSettings: _*) with seq(webSettings :_*) in project root's build.sbt