If you want to run code (e.g., unit tests), you need an
implementation, not just the API definitions. Again, the API jar
file was only intended to be used when compiling.
And yes, the reason all the code was removed from the API jar file
was to conform with the license and compatibility rules, which were
subsequently changed.
Marcel Schutte wrote on 11/28/18 02:51
AM:
Two points: first a +1 for Greg Wilkin's point
and secondly an objection against the following section:
An extreme example of an API jar file is the "jakartaee.jar"
file that we produce, which contains *no* code at all for
any of the classes, and is not a valid class file for use
at runtime. It is suitable only for reference by the compiler.
Most other API jar files will not take this extreme approach.
This disregards the use case of unit tests as is explained
in Adam Bien's article [1]
Bill et al,
I disagree with the following section:
The implementation jar file typically includes all the classes from
the API jar file, plus whatever implementation classes are needed
to produce a complete runtime.
In some cases the implementation jar file might contain only
the implementation artifacts, and depend on the API jar file
for the API definitions, although this is discouraged for
standalone implementations.
Having API classes in implementation jars just invites
duplicate classes and reduces flexibility. A jar that is
"standalone" in one deployment may well be used as
component in another, plus there is no general reason that
multiple versions of an API cannot be deployed in the same
classloader scope. These issues have always existed,
but will only be made more acute by JPMS.
The policy should default to having separate jars for
API and implementation, with perhaps a naming convention
for aggregating both if a single jar is really needed.
regards
--
_______________________________________________
jakarta.ee-community mailing list
jakarta.ee-community@xxxxxxxxxxx
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jakarta.ee-community
--
_______________________________________________
jakarta.ee-community mailing list
jakarta.ee-community@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jakarta.ee-community
|