eclipse-external-annotations-m2e-plugin
eclipse-external-annotations-m2e-plugin copied to clipboard
JDT doesn't react to external annotation paths set by this plugin
This project looks inactive since 2022, so I don't know whether I'm shouting in the desert... :sweat_smile: (Eclipse JDT seems still to support external annotations—although in a buggy and somewhat experimental manner—, so it's not easy to estimate whether this functionality is alive or doomed) Anyway...
Because of the sparse availability of external annotations (as you know, eg, JRE-related *.eea files from lastNPE repo are incomplete), I need to link plain *.eea files to edit them during development through the convenient popup menu command "Annotate" within the corresponding *.class files source view.
Unfortunately, the way Eclipse manages the configuration of external annotation paths is terrible: Eclipse JDT doesn't provide a way to set a common annotation path where to place *.eea files for both JRE and Maven Dependencies (*.eea files for JRE are set at workspace level via "Preferences/Java/Installed JREs" dialog, while for Maven Dependencies are set at project level, forcing users to edit the "Build Path" dialog of each and every project in a workspace!). The only alternative would be the "Search for external annotations in all build path locations" option, but it presumably applies only to external annotations packaged as JARs (thus unsuitable for edit). Icing on the cake, on my freshly-updated installation (Eclipse IDE 4.32, Eclipse JDT 3.19.500) external annotations configuration for Maven Dependencies doesn't work at all ("External annotations" path set within "Java Build Path/Libraries" dialog isn't saved!).
Due to the above-mentioned limitations/bugs in the way Eclipse manages the configuration of external annotation paths, I resorted to this promising plugin (eclipse-external-annotations-m2e-plugin), configured as follows:
- installed version: 2.0.0.202212171629
-
m2e.jdt.annotationpath
property set in the root pom.xml: "${rootdir}/src/main/eea
" (all *.eea files in my project are under "src/main/eea" directory — see tree view screenshot here below)
Despite the plugin gloriously worked as expected ("External annotations" paths for both JRE and Maven Dependencies were automatically set on each and every module of my project — see dialog screenshots here below), JDT doesn't react to those paths (nullness errors are still highlighted in my source code, method signatures in Javadoc view are not augmented with nullness annotations, and the popup menu command "Annotate" doesn't show up within the corresponding *.class files source view).
Evidently, there is a severe problem within Eclipse JDT which makes external annotations paths unusable.
Before reporting to JDT maintainers, I would like to know about your use experience and possible suggestions (I wonder why apparently nobody stumbled upon this problem before — is it a recent JDT regression? or nobody is actually using external annotations any more?)