无网络连接即可运行游戏

时间:2014-10-15 15:18:16

标签: playframework playframework-2.0

如何在没有网络连接的情况下开发Play Framework应用程序?每次运行play时,它都会尝试连接到某个存储库以下载内容:

[info] Loading project definition from C:\Users\Vincent\Documents\GitHub\TestApplication\play\project
[error] Server access Error: Connection reset url=http://repo.typesafe.com/typesafe/ivy-releases/commons-io/commons-io/2.0.1/ivys/ivy.xml
[error] Server access Error: Connection reset url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/commons-io/commons-io/2.0.1/ivys/ivy.xml
[error] Server access Error: Connection reset url=http://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbt/sbt-native-packager/scala_2.10/sbt_0.13/0.6.4/ivys/ivy.xml
[error] Server access Error: Connection reset url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.sbt/sbt-native-packager/scala_2.10/sbt_0.13/0.6.4/ivys/ivy.xml
[error] Server access Error: Connection reset url=http://repo.typesafe.com/typesafe/ivy-releases/org.apache.commons/commons-compress/1.4.1/ivys/ivy.xml
[error] Server access Error: Connection reset url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.apache.commons/commons-compress/1.4.1/ivys/ivy.xml
[error] Server access Error: Connection reset url=http://repo.typesafe.com/typesafe/ivy-releases/org.tukaani/xz/1.0/ivys/ivy.xml
[error] Server access Error: Connection reset url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.tukaani/xz/1.0/ivys/ivy.xml
[error] Server access Error: Connection reset url=http://repo.typesafe.com/typesafe/ivy-releases/org.specs2/specs2_2.10/2.1.1/ivys/ivy.xml
[error] Server access Error: Connection reset url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.specs2/specs2_2.10/2.1.1/ivys/ivy.xml
[error] Server access Error: Connection reset url=http://repo.typesafe.com/typesafe/ivy-releases/org.scalaz/scalaz-concurrent_2.10/7.0.2/ivys/ivy.xml
[error] Server access Error: Connection reset url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scalaz/scalaz-concurrent_2.10/7.0.2/ivys/ivy.xml
[error] Server access Error: Connection reset url=http://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.play/sbt-plugin/scala_2.10/sbt_0.13/2.2.5/jars/sbt-plugin.jar
[error] Server access Error: Connection reset url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.play/sbt-plugin/scala_2.10/sbt_0.13/2.2.5/jars/sbt-plugin.jar
Terminate batch job (Y/N)? Y

这些是我的sbt文件的内容:

plugins.sbt

// Comment to get more information during initialization
logLevel := Level.Warn

// The Typesafe repository
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"

// Use the Play sbt plugin for Play projects
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.0")

build.sbt

name := "TestApplication"

version := "{VERSION}"

libraryDependencies ++= Seq(
  javaJdbc,
  javaEbean,
  cache
)     

play.Project.playJavaSettings

Play working offline中的答案仅涉及部署/分发Play应用程序,而非开发。

1 个答案:

答案 0 :(得分:1)

您可以尝试在build.sbt中设置offline := true。大部分时间都有效。