Skip to content

Commit 49f76f6

Browse files
HannesWelllaeubi
andcommitted
Add N&N about extended classpath for Plug-in projects
and the possibility that it can lead to increased build runtime in specific cases. Co-authored-by: Christoph Läubrich <laeubi@laeubi-soft.de>
1 parent 3879862 commit 49f76f6

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

news/4.40/pde.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,48 @@ This release includes several performance and reliability improvements:
4343
- **Faster syntax highlighting in the target definition editor:** The presentation reconciler no longer scans content past the damaged region on every keystroke, so editing large `.target` files feels noticeably more responsive.
4444
- **More reliable target resolution:** Resolve jobs are now serialized per target handle, preventing duplicate parallel resolves and the resulting `Cannot invoke ProfileLock.unlock()` errors when reloading the same target definition.
4545

46+
### Complete classpath for plug-in projects
47+
<!-- https://github.com/eclipse-pde/eclipse.pde/pull/2253 -->
48+
<details>
49+
<summary>Contributors</summary>
50+
51+
- [Christoph Läubrich](https://github.com/laeubi)
52+
</details>
53+
54+
PDE's `Plug-in Dependencies` classpath container previously included only direct dependencies.
55+
This caused several long-standing problems:
56+
- **Spurious compile errors**`"The type X cannot be resolved. It is indirectly referenced from required type Y"` — appearing non-deterministically depending on which methods the code calls.
57+
- **Broken "Remove unused dependencies" action** — removing a dependency that is unused at runtime but still required for compilation broke the build, leaving users confused about which entries to keep.
58+
- **Inconsistencies with Tycho / Maven builds** — code compiled cleanly in the IDE but failed on CI, or vice versa, because Tycho has always used the full transitive classpath.
59+
- **Incomplete type hierarchies** — code navigation, content assist, and call hierarchy views were silently missing types that the OSGi runtime would have available.
60+
61+
To fix these problems, PDE now also adds all transitive dependencies of a plug-in to its classpath container, but configures them to be inaccessible from within the project.
62+
This makes the complete transitive hull of dependencies available for the Java compiler, fulfilling fundamental requirements of the Java type system.
63+
64+
Additionally, this aligns PDE's compilation model with Tycho and with what the OSGi runtime would actually have available.
65+
66+
#### Lean dependency tree
67+
68+
In setups with large dependency trees, the extended classpath may increase the initial build time, but we are continuously working on improving it.
69+
The usual recommendation is to keep dependencies as small as possible:
70+
- Use `Find unused dependencies` to remove manifest entries for plug-ins you no longer reference.
71+
This action now works reliably across the full transitive closure and has been validated against the Eclipse Platform codebase.
72+
- Maintain a clear API/implementation separation in your plug-ins.
73+
API plug-ins used by many consumers should not carry heavy implementation dependencies; this limits the transitive fanout for all their consumers.
74+
Use `Show plug-in dependency hierarchy` and `Show dependent plug-ins and fragments` to understand the impact.
75+
- If the extended classpath reveals _cyclic dependencies_, use `Look for cycles in the dependency graph` to trace the root cause.
76+
77+
#### Temporary workaround
78+
79+
To support the transition period, a system property is available:
80+
```
81+
-Dpde.addTransitiveDependenciesWithForbiddenAccess=false
82+
```
83+
Add this to your `eclipse.ini` to restore the previous (incomplete) classpath behavior for comparison and performance analysis.
84+
85+
**Important:** This property is intended solely as a temporary diagnostic aid and is planned to become a no-op in a future release without further notice.
86+
87+
4688
## Views and Dialogs
4789

4890
### CSS Spy Widget Hierarchy Export

0 commit comments

Comments
 (0)