For eclipse users who are debugging the following message might be familiar:
The JAR of this class file belongs to container ‚Plug-in Dependencies‘ which does not allow modifications to source attachments on its entries.
This always happens when Eclipse cannot find the source code for a plugin bundle which is part of your target platform but the target platform does not contain a accordant source bundle. This for example happend to me today with the embedded Jetty (org.mortbay.jetty_5.1.14.v200806031611.jar) inside the Eclipse Equinox OSGI platform which makes up my target platform.
When debugged and wanted to go into any class inside a jetty package I always got the message that it is a class from Plugin-Dependencies and the source attachment cannot be modified.
I solved it like this:
- Switch to the Plugins View in Eclipse ( Window / Show View / Plugins)
- locate the bundle org.mortbay.jetty
- right click on that bundle and select „Import as“ -> „Binary Project with linked content“
Now that Bundle shows up in your Package Explorer as a new Eclipse project, in my caseorg.mortbay.jetty.
Now right click on that new project in the package explorer and goto ‚Properties / Java Build Path / Libraries‘. You see the the jetty jar file there and if you expand this entry you can edit the ‚Source Attachment‘ as usual. I pointed it to the downloaded Jetty Source code located in a completely different folder than my target platform which I am using for my project.
Have posted this answer also here on Stackoverflow.