eclipse调试器:附加maven依赖的源代码? [英] eclipse debugger: attaching source-code of maven dependencies?

查看:178
本文介绍了eclipse调试器:附加maven依赖的源代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在myEclipse 8中调试我们的webapp时,使用maven管理依赖项的源代码。



我设法将源附加到库在Maven Managed Dependencies类路径容器中,即当我从依赖关系打开一个类文件(例如使用Ctrl-Shift-T)时,我看到源代码。



但是,当我为我的tomcat定义服务器连接器时,将wepapp部署到它,并在调试模式下启动它,并在同一个类的断点上执行停止,编辑器窗格只显示文本source not found,而一个按钮来编辑源查找路径。我尝试手动添加Maven Managed Dependencies类路径容器,只能被告知使用maven项目设置来配置依赖性解析。但是,我在该属性窗格中看不到有用的设置...



如何附加这些来源?我知道这与m2e插件和wtp一起工作,但我宁愿避免说服我的其他团队切换插件...

解决方案

我发现只有在使用启动配置启动服务器时才会出现此问题。



如果服务器启动,则不会出现此问题:


  1. 点击

  2. 点击开始
  3. ,在工具栏 - >上下文菜单中显示服务器图标
    < >

虽然这排除了通过检查启动配置到版本控制来共享服务器配置,但至少允许无缝调试。


I'd like to use the source code of maven-managed dependencies when debugging our webapp in myEclipse 8.

I have managed to attach the sources to the libraries in the "Maven Managed Dependencies" classpath container, i.e. when I open a class file from a dependency (e.g. using Ctrl-Shift-T), I see the source code.

However, when I define a server connector for my tomcat, deploy the wepapp to it, and launch it in debug mode and execution halts on a breakpoint in that same class, the editor pane only displays the text "source not found", and a button to edit the "source lookup path". I have attempted to manually add the "Maven Managed Dependencies" classpath container, only to be told "Use maven project settings to configure depedency resolution". However, I see no useful setting in that property pane ...

How can I attach those sources? I am aware that this works with the m2e plugin and wtp, but I'd rather avoid convincing the rest of my team to switch plugins ...

解决方案

I have since discovered that this problem only occurs if the server is launched using a launch configuration.

The problem does not occur if the server is started by:

  1. click the server icon in the toolbar -> context menu appears
  2. mouse over the intended server -> submenu appears
  3. click on "Start"

While this precludes sharing the server configuration by checking the launch configuration into version control, it at least allows seamless debugging.

这篇关于eclipse调试器:附加maven依赖的源代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆