简体   繁体   English

在Eclipse IDE中附加playframework源以进行调试的最佳方法是什么

[英]What's the best way of attaching playframework sources for debugging in Eclipse IDE

I am implementing a set of backend RESTful services using the PlayFramework (v2.3.8) and its plugin play-authenticate (v0.6.8), and would like to find an easier way of attaching their source code in eclipse for debugging (both of playframework and of whatever other dependency I use). 我正在使用PlayFramework (v2.3.8)及其插件play-authenticate (v0.6.8)实现一组后端RESTful服务,并希望找到一种更简单的方法将其源代码附加到eclipse中进行调试(两者都是playframework以及我使用的任何其他依赖项。

To download sources, I am adding withSources() both to the build.sbt (for dependencies) and to plugin.sbt (for the sbt play plugin), however this doesn't bring me all the source code of playframework (ie, I still need to add the source code of each module of the framework one by one - see the build.sbt example below), and it does not include them automatically on the classpath when I use activator eclipse , which means I have to manually "Attach source" for each compiled class the debugger doesn't find in the classpath. 要下载源代码,我将builds()添加到build.sbt (用于依赖项)和plugin.sbt (用于sbt play插件),但是这并没有给我带来playframework的所有源代码(即,我仍然需要逐个添加框架的每个模块的源代码 - 请参阅下面的build.sbt示例),当我使用activator eclipse时,它不会自动在类路径中包含它们,这意味着我必须手动“附加”源代码“对于调试器在类路径中找不到的每个编译类。

Is there any way of making this process easier, automatically adding all source code jars to the project's classpath, and making eclipse to automatically attach these sources when debugging? 有没有办法让这个过程更容易,自动将所有源代码jar添加到项目的类路径中,并使eclipse在调试时自动附加这些源?

my build.sbt 我的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? 
)

my plugins.sbt 我的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")

You need to set flag. 你需要设置标志。 activator eclipse with-source=true according to Documentation https://www.playframework.com/documentation/2.3.x/IDE 根据文档https://www.playframework.com/documentation/2.3.x/IDE,activator eclipse with-source = true

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM