Re: Annotation scanning with java 9 multi version jars



I don't see an application of MR to EAR, but EARs don't package classes directly, so that seems natural.  (But are there any resource loading cases for EAR files?)

Reasons that I'm finding that suggest that WAR should support MR is that (1) the extension seems straightforward; and (2) the use of MR for other module types is direct, meaning, MR enablement may be likely for other module types (3) having fragment JARs support MR but having the WAR itself not seems exceptional behavior.

In any case, if fragment JARS *do* support MR, we still have the main question: What are the rules for scanning annotations?

My simplest answer is that since JavaEE/servlet annotations are an alternate to metadata which can be specified in a descriptor, and descriptors live in WEB-INF (or META-INF), and those are single versioned, then, JavaEE/servlet annotations should be single versioned.  Then, all annotations must be present in base class versions, and no alteration is permitted (or is visible) in MR version specific classes.

I presume that this applies to not only descriptor type annotations, but also to Servlet Container Initializer (SCI) related annotations.

Despite this rule, there might be a problem, in that annotation processing can involve class relationships (superclasses and interfaces).  Would superclasses or interfaces be allowed to vary for annotated classes across MR versions?

Thomas Bitonti

Join to automatically receive all group messages.