从Play Framework中删除路由时推送到Heroku时出错

时间:2014-08-03 05:00:25

标签: heroku playframework-2.3

在我的承诺中我:

  • 删除了控制器类:com.fractalemagic.Crashes
  • 从conf / routes
  • 中删除了相关的行

Heroku构建日志:

-----> Play 2.x - Java app detected
-----> Installing OpenJDK 1.8...done
-----> Running: sbt compile stage
       OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0
       Getting org.scala-sbt sbt 0.13.5 ...
       :: retrieving :: org.scala-sbt#boot-app
        confs: [default]
        44 artifacts copied, 0 already retrieved (13482kB/434ms)
       Getting Scala 2.10.4 (for sbt)...
       :: retrieving :: org.scala-sbt#boot-scala
        confs: [default]
        5 artifacts copied, 0 already retrieved (24459kB/193ms)
       [info] Loading project definition from /tmp/scala_buildpack_build_dir/project
       [info] Set current project to SomethingMagical (in build file:/tmp/scala_buildpack_build_dir/)
       [info] Compiling 6 Scala sources and 25 Java sources to /tmp/scala_buildpack_build_dir/target/scala-2.11/classes...
       [error] /tmp/scala_buildpack_build_dir/target/scala-2.11/src_managed/main/com/fractalemagic/routes.java:8: error: cannot find symbol
       [error] public static final com.fractalemagic.ReverseCrashes Crashes = new com.fractalemagic.ReverseCrashes();
       [error]                                      ^
       [error]   symbol:   class ReverseCrashes
       [error]   location: package com.fractalemagic
       [error] /tmp/scala_buildpack_build_dir/target/scala-2.11/src_managed/main/com/fractalemagic/routes.java:11: error: package com.fractalemagic.javascript does not exist
       [error] public static final com.fractalemagic.javascript.ReverseCrashes Crashes = new com.fractalemagic.javascript.ReverseCrashes();
       [error]                                                 ^
       [error] /tmp/scala_buildpack_build_dir/target/scala-2.11/src_managed/main/com/fractalemagic/routes.java:16: error: package com.fractalemagic.ref does not exist
       [error] public static final com.fractalemagic.ref.ReverseCrashes Crashes = new com.fractalemagic.ref.ReverseCrashes();
       [error]                                          ^
       [error] /tmp/scala_buildpack_build_dir/target/scala-2.11/src_managed/main/com/fractalemagic/routes.java:8: error: cannot find symbol
       [error] public static final com.fractalemagic.ReverseCrashes Crashes = new com.fractalemagic.ReverseCrashes();
       [error]                                                                                     ^
       [error]   symbol:   class ReverseCrashes
       [error]   location: package com.fractalemagic
       [error] /tmp/scala_buildpack_build_dir/target/scala-2.11/src_managed/main/com/fractalemagic/routes.java:11: error: package com.fractalemagic.javascript does not exist
       [error] public static final com.fractalemagic.javascript.ReverseCrashes Crashes = new com.fractalemagic.javascript.ReverseCrashes();
       [error]                                                                                                           ^
       [error] /tmp/scala_buildpack_build_dir/target/scala-2.11/src_managed/main/com/fractalemagic/routes.java:16: error: package com.fractalemagic.ref does not exist
       [error] public static final com.fractalemagic.ref.ReverseCrashes Crashes = new com.fractalemagic.ref.ReverseCrashes();
       [error]                                                                                             ^
       [error] Note: Some input files use or override a deprecated API.
       [error] Note: Recompile with -Xlint:deprecation for details.
       [error] Note: /tmp/scala_buildpack_build_dir/app/Global.java uses unchecked or unsafe operations.
       [error] Note: Recompile with -Xlint:unchecked for details.
       [error] 6 errors
       [error] (compile:compile) javac returned nonzero exit code
       [error] Total time: 22 s, completed Aug 2, 2014 8:46:52 PM
 !     Failed to build app with sbt

 !     Push rejected, failed to compile Play 2.x - Java app

我尝试使用Activator在本地运行项目时遇到了同样的错误但在我运行activator clean之后它运行正常。

我在构建日志中注意到Heroku只编译代码:

-----> Running: sbt compile stage

根据:https://devcenter.heroku.com/articles/play-support#activation

它也应该清理。

在撤销提交后,我能够成功推送到Heroku。

2 个答案:

答案 0 :(得分:2)

您链接的文档似乎有点过时了。您需要通过设置环境变量SBT_CLEAN=true

来专门告诉heroku进行干净编译

如果你正在使用heroku toolbelt:

heroku config:set SBT_CLEAN=true -a your-app-name

Heroku Build Behavior

答案 1 :(得分:0)

对我来说,我通过删除目标下的所有内容然后重新编译来解决问题。