Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying Play 2.1-SNAPSHOT based application to Heroku

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.

like image 519
InPursuit Avatar asked May 17 '12 00:05

InPursuit


People also ask

How do I deploy an existing app to Heroku?

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.

Can I host a Java application on Heroku?

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.

Can you deploy a full stack app on Heroku?

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.


2 Answers

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)
like image 119
arashi01 Avatar answered Oct 24 '22 03:10

arashi01


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)
like image 31
InPursuit Avatar answered Oct 24 '22 02:10

InPursuit