-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jdt debugger does not find sources when Tycho Project Configurators is installed #32
Comments
Apparently, the problem is only in the Tycho Project Configurators 0.9.x: with version 0.8.x, which is the one proposed automatically if you have projects configured with a tycho build, the problem is not there. I was using 0.9.0 since I thought it was the latest release, but probably that's not the case and it's only a snapshot? |
You may want to try my "advanced" source lookup tech (can be installed form this p2 repository). It supports Debug As JUnit Plugin Test and Eclipse Application launch configuration and should be compatible with latest Eclipse and M2E releases. |
@ifedorenko thank you for the suggestion, and I'll try that. However, the problem I was referring to happens when you debug from Eclipse as plain JUnit, not as JUnit Plugin Test. |
@ifedorenko I did some further investigations that I report here, hoping they're useful to fix this problem: when the Tycho project configurator 0.9.0 is used, the launch configuration adds these two additional entries: <stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/> which are responsible for NOT finding sources of other projects (including their dependencies). Manually removing those two entries brings the launch configuration to a working state (sources of other projects and dependencies are correctly found during debugging). A working launch configuration can be found here: https://github.com/LorenzoBettini/tycho-simple-example/blob/78bbe0c28d38f0b6639ab007f07de0123f5a0d31/example.parent/example.tests/MyClassTest.launch. Upgrading the Tycho project configurator from 0.8.0 to 0.9.0 will modify this launch configuration to a NON working state adding the two above entries. Can the problem be due to this commit fae253e? I see there's a comment from you (fae253e#diff-703464cb85074c6e19ca4d67df3b862fR132):
|
Unfortunately I have some bad updates (I've just realized that after seeing #34): the problem is still there also with tycho project configurator 0.8.0 (and also with 0.8.1): as soon as I open an existing launch configuration in the Run Configurations... dialog the two above mentioned entries are automatically added: <stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/> breaking completely the debugging features... Sources of other projects (and dependencies) are not automatically available for any new debug configurations, making debugging a real pain... The only solution is to uninstall the tycho project configurator plugin and get run of the launches saved in the workspace org.eclipse.debug.core/.launches. |
Have you tried advanced sourcelookup? I am debugging m2e and bunch of in-house projects without problems. |
@ifedorenko where can I find "advanced sourcelookup"? I mean in which preference/configuration? Can you share some of the projects you're using? Note that the problems I experience when debugging are due to sources in other projects from the one where I'm debugging (e.g., JUnit tests in a different project) and to sources of plugin (PDE) dependencies. |
you can install it from https://repository.takari.io/content/sites/m2e.extras/sourcelookup/1.2.0/N/LATEST/ edit: the project github repo has some info about features and mode of operation https://github.com/ifedorenko/com.ifedorenko.m2e.sourcelookup |
If you have PDE projects with Maven nature (configured with Tycho), and you try to debug, e.g. a JUnit Test Case in a .tests project that tests a Java class in another project, then JDT debugger cannot find the sources of the classes of other projects (nor sources of possible dependencies used by the classes under test) if you have "Tycho Project Configurators" installed in your Eclipse.
For example, take the projects found here: https://github.com/LorenzoBettini/tycho-simple-example
MyClass
(in project example.plugin) and you can debug such class running the JUnit testMyClassTest
in the project example.tests: the debugger can seamlessly find the sources ofMyClass
.MyClass
cannot be found.Note that if this happens, and you uninstall the Tycho Project Configurators, debugger will work again (it will find the sources) ONLY if you use another fresh workspace or if you first remove a few folders in the .metadata directory (I did some tests and I had to remove .jdt., .debug. and .m2e.). Since I found no file left from the Tycho Project Configurators in the .metadata directory, can it be that m2eclipse-tycho interferes with some JDT indexes?
I'm using Eclipse Neon 2 and the Tycho Project Configurators taken from http://repo1.maven.org/maven2/.m2e/connectors/m2eclipse-tycho/0.9.0/N/LATEST
The text was updated successfully, but these errors were encountered: