我刚刚开始使用Play Framework。我已经下载并安装了play并创建了一个示例java应用程序。当我尝试在应用程序目录中启动播放控制台时,它会挂起“正在加载项目定义”。
PS C:\dev\play\javatest> play.bat
Getting org.scala-sbt sbt_2.9.1 0.11.3 ...
:: retrieving :: org.scala-sbt#boot-app
confs: [default]
37 artifacts copied, 0 already retrieved (7245kB/283ms)
[info] Loading project definition from C:\dev\play\myFirstApp\project
当我尝试运行Scala应用程序时,我收到有关它等待锁定的消息:
PS C:\dev\play\scalatest> play
[info] Loading project definition from C:\dev\play\test1\project
Waiting for lock on C:\lib\play\repository\.sbt.ivy.lock to be available...
运行Windows 7,JDK 1.7.0_05和Play Framework 2.0.2。有什么想法吗?
答案 0 :(得分:125)
我刚刚在Play 2中体验过这一点,事实证明它并没有真正悬挂,它只是拉着一个maven并下载了互联网。要验证这与您遇到编辑project/plugins.sbt
并替换:
logLevel := Level.Warn
与
logLevel := Level.Debug
(虽然我在OSX上构建,但我想你会在Windows上遇到类似的输出。)
答案 1 :(得分:2)
只是在这里添加现有答案,
我从Play 2.2x升级到Play 2.3.x之后也看到了这种行为(见MigrationGuide)
我正在调试如下。
在Linux上,转到项目文件夹,然后:
$ bash -x `which sbt`
.... OUTPUT SKIPPED....
++ (( 128 < 512 ))
++ local 'common_opts=-Xms1024m -Xmx1024m -XX:ReservedCodeCacheSize=128m'
++ [[ 1.7.0_55 < 1.8 ]]
++ local perm=256
++ echo '-Xms1024m -Xmx1024m -XX:ReservedCodeCacheSize=128m -XX:MaxPermSize=256m'
+ execRunner java -Xms1024m -Xmx1024m -XX:ReservedCodeCacheSize=128m -XX:MaxPermSize=256m -jar /usr/share/sbt-launcher-packaging/bin/sbt-launch.jar
+ [[ -n '' ]]
+ [[ -n '' ]]
+ java -Xms1024m -Xmx1024m -XX:ReservedCodeCacheSize=128m -XX:MaxPermSize=256m -jar /usr/share/sbt-launcher-packaging/bin/sbt-launch.jar
记下最后一行中的命令,取消当前流程Ctrl+C
,然后将-verbose
选项添加到java
执行:{/ p>
java -verbose -Xms1024m -Xmx1024m -XX:ReservedCodeCacheSize=128m -XX:MaxPermSize=256m -jar /usr/share/sbt-launcher-packaging/bin/sbt-launch.jar
最后,我还在logLevel := Level.Debug
中添加了project/plugins.sbt
。
然而,它不断提供如下输出:
.... OUTPUT SKIPPED....
info] [SUCCESSFUL ] org.apache.maven.doxia#doxia-sink-api;1.1!doxia-sink-api.jar (2065ms)
[debug] tried http://repo.typesafe.com/typesafe/ivy-releases/org.apache.maven.doxia/doxia-logging-api/1.1/jars/doxia-logging-api.jar
[debug] CLIENT ERROR: Not Found url=http://repo.typesafe.com/typesafe/ivy-releases/org.apache.maven.doxia/doxia-logging-api/1.1/jars/doxia-logging-api.jar
[debug] tried http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.apache.maven.doxia/doxia-logging-api/1.1/jars/doxia-logging-api.jar
[debug] CLIENT ERROR: Not Found url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.apache.maven.doxia/doxia-logging-api/1.1/jars/doxia-logging-api.jar
[debug] tried /home/saleem/.ivy2/local/org.apache.maven.doxia/doxia-logging-api/1.1/jars/doxia-logging-api.jar
[debug] tried http://repo1.maven.org/maven2/org/apache/maven/doxia/doxia-logging-api/1.1/doxia-logging-api-1.1.jar
[info] downloading http://repo1.maven.org/maven2/org/apache/maven/doxia/doxia-logging-api/1.1/doxia-logging-api-1.1.jar ...
[debug] public: downloading http://repo1.maven.org/maven2/org/apache/maven/doxia/doxia-logging-api/1.1/doxia-logging-api-1.1.jar
[debug] public: downloading http://repo1.maven.org/maven2/org/apache/maven/doxia/doxia-logging-api/1.1/doxia-logging-api-1.1.jar.sha1
[debug] sha1 OK for http://repo1.maven.org/maven2/org/apache/maven/doxia/doxia-logging-api/1.1/doxia-logging-api-1.1.jar
[info] [SUCCESSFUL ] org.apache.maven.doxia#doxia-logging-api;1.1!doxia-logging-api.jar (3997ms)
[debug] tried http://repo.typesafe.com/typesafe/ivy-releases/org.apache.maven/maven-plugin-registry/2.2.1/jars/maven-plugin-registry.jar
[debug] CLIENT ERROR: Not Found url=http://repo.typesafe.com/typesafe/ivy-releases/org.apache.maven/maven-plugin-registry/2.2.1/jars/maven-plugin-registry.jar
[debug] tried http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.apache.maven/maven-plugin-registry/2.2.1/jars/maven-plugin-registry.jar
[debug] CLIENT ERROR: Not Found url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.apache.maven/maven-plugin-registry/2.2.1/jars/maven-plugin-registry.jar
[debug] tried /home/saleem/.ivy2/local/org.apache.maven/maven-plugin-registry/2.2.1/jars/maven-plugin-registry.jar
[debug] tried http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-registry/2.2.1/maven-plugin-registry-2.2.1.jar
[info] downloading http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-registry/2.2.1/maven-plugin-registry-2.2.1.jar ...
[debug] public: downloading http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-registry/2.2.1/maven-plugin-registry-2.2.1.jar
[debug] public: downloading http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-registry/2.2.1/maven-plugin-registry-2.2.1.jar.sha1
[debug] sha1 OK for http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-registry/2.2.1/maven-plugin-registry-2.2.1.jar
[info] [SUCCESSFUL ] org.apache.maven#maven-plugin-registry;2.2.1!maven-plugin-registry.jar (2025ms)
[debug] tried http://repo.typesafe.com/typesafe/ivy-releases/backport-util-concurrent/backport-util-concurrent/3.1/jars/backport-util-concurrent.jar
[debug] CLIENT ERROR: Not Found url=http://repo.typesafe.com/typesafe/ivy-releases/backport-util-concurrent/backport-util-concurrent/3.1/jars/backport-util-concurrent.jar
[debug] tried http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/backport-util-concurrent/backport-util-concurrent/3.1/jars/backport-util-concurrent.jar
[debug] CLIENT ERROR: Not Found url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/backport-util-concurrent/backport-util-concurrent/3.1/jars/backport-util-concurrent.jar
[debug] tried /home/saleem/.ivy2/local/backport-util-concurrent/backport-util-concurrent/3.1/jars/backport-util-concurrent.jar
[debug] tried http://repo1.maven.org/maven2/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
[info] downloading http://repo1.maven.org/maven2/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar ...
[debug] public: downloading http://repo1.maven.org/maven2/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
.... OUTPUT SKIPPED....
似乎有太多的罐子需要下载。我现在正在使用Typesafe Activator的离线版本(356MB下载here),这要快得多!
答案 2 :(得分:0)
尝试中止您的构建,删除引用的锁定文件,然后再次执行“play run”。