I've downloaded the source for all the Maven JARs in my buildpath using Maven->Download Sources and mvn eclipse:eclipse -DdownloadSources=true
, which worked! When I open up the build path I can see that the sources JARs are attached for every JAR file.
But when I run the damn thing on Tomcat 6 I keep getting "Source not found" page with "Edit Source lookup path" button. But the source is already attached in the build path. What isn't this working?
When I manually point it to the JAR file by clicking on the "Edit Source lookup path" button it works. And when I manually point it to the folder it does not work. Why isn't Eclipse or Tomcat picking up the attached source in the build path?
Note: I'm using apache-maven-3.0.4, apache-tomcat-6.0.16 and Eclipse Indigo Service Release 2.
Via the Maven index, you can search for dependencies, select them and add them to your pom file. To download the index, select Windows > Preferences > Maven and enable the Download repository index updates on startup option. After changing this setting, restart Eclipse. This triggers the download of the Maven index.
Although this bug had the most votes of all bugs @Sonatype, it hasn't been fixed.
However I have filled an enhancement request on Eclipse Bugzilla and if you agree this issue "Source not found" should be fixed, please vote for it here.
You can found three workarounds here.
I found this com.ifedorenko.m2e.sourcelookup plugin. The link was provided in "Java Debugging: Source not found".
Go to Help > Install New Software ..
and use
http://ifedorenko.github.com/m2e-extras/
to search for the links. After installing this plugin I was finally able to debug the source code of dependencies.
Use External Maven instead of default Embedded in Debug Configurations dialogue.
Please see example screenshot below (menu Run -> Debug Configurations...):
Configure external Maven
Tested environment:
hpi:run
(sample Jenkins plugin)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With