[英]Scala Play 2.3.5 - Coveralls sbt plugin java.io.IOException: Unable to download JavaScript
I am currently trying to setup a play scala project buildchain with travis, heroku and coveralls sbt plugin for codecoverage. 我目前正在尝试使用travis,heroku和工作服sbt插件来建立play scala项目buildchain,以实现代码覆盖率。 I have created a clean scala play app with the activator and just added the coveralls plugin and a travis.yml.
我已经使用激活程序创建了一个干净的scala play应用程序,并刚刚添加了工作服插件和travis.yml。
When I push my project and trigger the build I get the following exception while travis runs the tests: 当我推送项目并触发构建时,在travis运行测试时遇到以下异常:
[error] c.g.h.h.HtmlPage - Error loading JavaScript from [http://localhost:19001/assets/javascripts/hello.js].
java.io.IOException: Unable to download JavaScript from 'http://localhost:19001/assets/javascripts/hello.js' (status 404).
at com.gargoylesoftware.htmlunit.html.HtmlPage.loadJavaScriptFromUrl(HtmlPage.java:1106) ~[htmlunit-2.13.jar:2.13]
at com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:1039) ~[htmlunit-2.13.jar:2.13]
at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:409) [htmlunit-2.13.jar:2.13]
at com.gargoylesoftware.htmlunit.html.HtmlScript$3.execute(HtmlScript.java:266) [htmlunit-2.13.jar:2.13]
at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:286) [htmlunit-2.13.jar:2.13]
I have found this old topic ( https://groups.google.com/forum/#!topic/play-framework/yj4NT3BO0Os ) with the same errormessage but unfortunately none of the solutions there worked for me. 我发现这个旧主题( https://groups.google.com/forum/#!topic/play-framework/yj4NT3BO0Os )带有相同的错误消息,但不幸的是,那里的解决方案都不适合我。
Does anyone here use coveralls or know a solution for my problem? 这里有人使用工作服或知道解决我的问题的方法吗? I ve attached all configuration files.
我已经附上了所有配置文件。
build.sbt build.sbt
import scoverage.ScoverageSbtPlugin.instrumentSettings
import org.scoverage.coveralls.CoverallsPlugin.coverallsSettings
name := """buildchain"""
version := "1.0-SNAPSHOT"
scalaVersion := "2.11.1"
lazy val root = (project in file(".")).enablePlugins(PlayScala)
libraryDependencies ++= Seq(
jdbc,
anorm,
cache,
ws
)
instrumentSettings
CoverallsPlugin.coverallsSettings
ScoverageKeys.minimumCoverage := 1
ScoverageKeys.failOnMinimumCoverage := true
plugins.sbt: plugins.sbt:
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
resolvers += Classpaths.sbtPluginReleases
// The Play plugin
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.5")
// web plugins
addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % "1.0.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.0.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-jshint" % "1.0.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-rjs" % "1.0.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.0.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-mocha" % "1.0.0")
// code coverage
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "0.99.7.1")
addSbtPlugin("org.scoverage" %% "sbt-coveralls" % "0.99.0")
travis.yml travis.yml
language: scala
scala:
- 2.11.2
script: "sbt coveralls"
notifications:
email: false
The issue is with sbt-scoverage and has been fixed in release 1.0.0. 该问题与sbt-coverage有关,已在1.0.0版中修复。 Please note that you have to update the way you use the plugin, so refer to the setup guide on the readme.
请注意,您必须更新使用插件的方式,因此请参阅自述文件上的安装指南。
https://github.com/scoverage/sbt-scoverage https://github.com/scoverage/sbt-scoverage
The error says you are getting an HTTP 404 (Not Found) error: 该错误表明您收到HTTP 404(未找到)错误:
java.io.IOException: Unable to download JavaScript from 'http://localhost:19001/assets/javascripts/hello.js' (status 404)
so I'm thinking this isn't so much a problem with your tools but just simply a plain old "not found" issue. 因此,我认为这不是您的工具存在的问题,而仅仅是一个普通的“未找到”问题。 Do you have an assets/javascripts/hello.js file in your project?
您的项目中是否有asset / javascripts / hello.js文件?
It seems that this is an issue with the sbt-scoverage plugin and play. 看来这是sbt-scoverage插件和播放的问题。 I hope that this issue will be resolved in the future...
我希望这个问题将来能解决...
https://github.com/scoverage/sbt-scoverage/issues/52 https://github.com/scoverage/sbt-scoverage/issues/52
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.