I have a Play 2.1-SNAPSHOT based application that runs fine locally but when I try to deploy to Heroku I get the following error:
[warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: UNRESOLVED DEPENDENCIES :: [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: play#sbt-plugin;2.1-SNAPSHOT: not found [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] [warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested
attributes.
My plugins.sbt file points to a local repository containing the 2.1-SNAPSHOT dependencies:
resolvers ++= Seq(
"Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/",
Resolver.file("My Repository", file( "repository/local") )
)
// Use the Play sbt plugin for Play projects
addSbtPlugin("play" % "sbt-plugin" % "2.1-SNAPSHOT")
The directory "repository/local" is checked into my GIT repository. It does look like SBT on Heroku is looking in the local repository since before the "Unresolved Dependency" error I see the following warnings:
[warn] ==== Typesafe repository: tried [warn] http://repo.typesafe.com/typesafe/releases/play/sbt-plugin_2.9.1_0.11.2/2.1-SNAPSHOT/sbt-plugin-2.1-SNAPSHOT.pom [warn] ==== My Repository: tried [warn] ==== heroku-sbt-typesafe: tried [warn] ==== heroku-central: tried
Running the command "play stage" locally finishes successfully.
To deploy your app to Heroku, use the git push command to push the code from your local repository's main branch to your heroku remote. For example: $ git push heroku main Initializing repository, done.
You can deploy any Java application on Heroku. It is not limited to JEE or other frameworks. You can deploy Java web applications packaged as WAR files using WAR deployment or you can deploy Maven based Java projects of any kind using the git versioning system.
In the Heroku GUI, within your app's dashboard, navigate to the Deploy tab and click the Deploy Branch button. After the app finishes building, click the View button to see your new full-stack app up-and-running.
An alternative is to add the Typesafe ivy-snapshots repository as a plugin resolver if you'd prefer to not use a local file repo.
In project/plugins.sbt:
resolvers += Resolver.url("Typesafe Ivy Snapshots", url("http://repo.typesafe.com/typesafe/ivy-snapshots/"))(Resolver.ivyStylePatterns)
Found the issue. I needed to declare "My Repository" as an Ivy repository by adding "Resolver.ivyStylePatterns" after the file resolver like this:
Resolver.file("My Repository", file( "repository/local/") )(Resolver.ivyStylePatterns)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With