Happosade
Happosade

Reputation: 11

Cannot deploy play-tutorial to Heroku

I am trying to do exactly what tutorial said but I keep having this error. The tutorial was the very first to-do. (So the source is exactly same than in here)

   [info]   [SUCCESSFUL ] org.easytesting#fest-util;1.1.6!fest-util.jar (293ms)
   [info] Done updating.
   [info] Compiling 4 Scala sources and 3 Java sources to /tmp/build_3oqhsaxc7iatb/target/scala-2.10/classes...
   [error] /tmp/build_3oqhsaxc7iatb/app/controllers/Application.java:6: object data is not a member of package play
   [error] import play.data.validation.Constraints.*;
   [error]        ^
   [error] /tmp/build_3oqhsaxc7iatb/app/controllers/Application.java:7: object data is not a member of package play
   [error] import play.data.*;
   [error]        ^
   [error] /tmp/build_3oqhsaxc7iatb/app/models/Task.java:5: object db is not a member of package play
   [error] import play.db.ebean.*;
   [error]        ^
   [error] /tmp/build_3oqhsaxc7iatb/app/models/Task.java:6: object data is not a member of package play
   [error] import play.data.validation.Constraints.*;
   [error]        ^
   [error] /tmp/build_3oqhsaxc7iatb/app/models/Task.java:8: object persistence is not a member of package javax
   [error] import javax.persistence.*;
   [error]        ^
   [error] /tmp/build_3oqhsaxc7iatb/app/models/Task.java:11: not found: type Model
   [error] public class Task extends Model{
   [error]                           ^
   [error] /tmp/build_3oqhsaxc7iatb/app/views/index.scala.html:6: Int does not take parameters
   [error]  <h1>@tasks.size() task(s)</h1>
   [error]                 ^
   [error] 7 errors found
   [error] (compile:compile) Compilation failed
   [error] Total time: 116 s, completed May 19, 2013 8:37:52 PM

! Failed to build app with sbt ! Heroku push rejected, failed to compile Play 2.x - java app

Upvotes: 1

Views: 1031

Answers (1)

arthur.sw
arthur.sw

Reputation: 11619

Ok, it seems my problem was just the projects/Build.scala file, here is a working version:

import sbt._
import Keys._
import play.Project._

object ApplicationBuild extends Build {

  val appName         = "todolist"
  val appVersion      = "1.0-SNAPSHOT"

  val appDependencies = Seq(
    // Add your project dependencies here,
    javaCore,
    javaJdbc,
    javaEbean,
    "postgresql" % "postgresql" % "9.1-901.jdbc4"
  )

  val main = play.Project(appName, appVersion, appDependencies).settings(
    // Add your own project settings here      
  )

}

I followed this tutorial and did not understand correctly how to set the Build.scala file.

Upvotes: 1

Related Questions