【问题标题】:What's the best way of attaching playframework sources for debugging in Eclipse IDE在 Eclipse IDE 中附加用于调试的 playframework 源的最佳方法是什么
【发布时间】:2015-03-12 01:31:06
【问题描述】:

我正在使用 PlayFramework (v2.3.8) 及其插件 play-authenticate (v0.6.8) 实现一组后端 RESTful 服务,并希望找到一种更简单的方法在 eclipse 中附加其源代码调试(游戏框架和我使用的任何其他依赖项)。

要下载源代码,我将 withSources() 添加到 build.sbt(用于依赖项)和 plugin.sbt(对于 sbt play 插件),但是这并没有给我带来 playframework 的所有源代码(即,我仍然需要一一添加框架的每个模块的源代码 - 参见下面的 build.sbt 示例),当我使用 activator eclipse 时,它不会将它们自动包含在类路径中,这意味着我必须为调试器在类路径中找不到的每个已编译类手动“附加源”。

有什么方法可以让这个过程更简单,自动将所有源代码 jar 添加到项目的类路径中,并让 eclipse 在调试时自动附加这些源?

我的 build.sbt

libraryDependencies ++= Seq(
  javaJdbc,
  javaEbean,
  cache,
  javaWs, 
  "com.feth" %% "play-authenticate" % "0.6.8" withSources(), 
  "com.typesafe.play" % "play_2.11" % "2.3.7" withSources(), // how to download all play-framework module source code at once? 
  "com.typesafe.play" % "play-java_2.11" % "2.3.8" withSources(), // how to download all play-framework module source code at once?  
  "org.springframework" % "spring-context" % "4.0.3.RELEASE" withSources() // how to download all dependencies source code at once? 
)

我的 plugins.sbt

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

// The Play plugin
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.8" withSources() withJavadoc())

// 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")

【问题讨论】:

    标签: java eclipse playframework


    【解决方案1】:

    你需要设置标志。根据文档https://www.playframework.com/documentation/2.3.x/IDE 激活器eclipse with-source=true

    【讨论】:

    • 这很好。不知道我是怎么错过那个选项的。将对其进行测试并让您知道它是否真的有效
    • 很久过去了,但公平地说,我必须确认您的回答有效:-)
    猜你喜欢
    • 2013-09-02
    • 2013-05-22
    • 2015-03-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-02
    • 2023-03-15
    • 2010-11-23
    相关资源
    最近更新 更多