eclipse debugger: attaching source-code of maven dependencies?

Viewed 18914

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 ...

4 Answers

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.

Related