Community
Participate
Working Groups
I have the following error on Eclipse 4.11.0 using a conditional breakpoint over a class of a maven dependency: Conditional Breakpoint Error Conditional breakpoint has compilation error(s). Reason: Unable to compile conditional breakpoint - missing Java project context. Conditional breakpoints works perfectly with any java source, but not with maven dependencies. With older versions (for example, Oxygen) it worked perfectly. Thanks for your attention.
Please either provide steps to reproduce the problem or attach an example project.
Of course. 1. Create a simple Maven project 2. Add some dependencies in the pom.xml 3. Create a Java main class that uses some classes of the dependencies 4. Create a new breakpoint in a class of a dependency 5. Debug the main class In my case, at the point 4. the conditional breakpoint doesn't solve any variable. At the point 5. I have the error I showed. However, Eclipse opens the source of the class, but in the same way as a regular file not linked to any source (so, you haven't any Java feature, you can't do CTRL-click, etc....) But I can regularly open the library class in the correct view from the main class. There's not connection between the maven sources and the java project in debug mode.
Looks like the build path is not correct.
The build path is correct, is not an issue related to the build path, because the same project, opened with an older version of Eclipse, is working!
If it can be useful, I can solve the problem making "Edit source lookup", and checking the option "source for duplicate sources". The sources seems duplicated: I have both the class and the java file taken from the -sources.jar file in .m2 folder
So Eclipse seems to prefer the .java file by default, taken from the maven -sources jar file, but this file is not linked to the project like the .class file. The strange thing is that if I open the .class file, I can see the source as I open the .java file.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.
Created attachment 288484 [details] Opened editors Opened files from 1) Debugger 2) Open Type
I still have the same issue. It doesn't seem to be about conditional breakpoints only but the way debugger opens classes from Maven dependencies (see attachment "Opened editors"). The first tab (with the "J" icon) is opened by debugger. Hovering over it shows the path as a tooltip and it's "~/.m2/repository/.../*-sources.jar/../*.java". The editor opened by "Open Type" (with the "010" icon) has the qualified class name as tooltip. So for some reason debugger chooses to open the source like an external source file, hence the "missing Java project context".
Please open a bug for m2e. Source lookup is delegated to the launch providers, so if m2e configures somehow sources it should make sure this is done in the way, *right* sources are found.
I've opened https://github.com/eclipse-m2e/m2e-core/issues/659