Versioning of META-INF/services

Jan Bartel janb at webtide.com
Mon Oct 30 23:54:28 UTC 2017


I asked this question over on the jdk9-dev list and they suggested I ask it
here instead:

http://openjdk.java.net/jeps/238 says:

"JAR metadata, such as that found in the MANIFEST.MF file and the
META-INF/services directory, need not be versioned."

Does the language "need not" actually mean "is not", or is the intention to
leave the door open to versioning of META-INF/services?

If it is possible to version services, is there any requirement that the
annotations on a service must be the same for all versions of that service
in a multi-release jar?

The motivation for the question is a scenario where we need to support
build and pre-deployment discovery of services on a different version of
the jvm (ie 9) to deployment/runtime (ie 8).  During discovery we examine
services returned from the ServiceLoader for particular annotations, such
as the @HandlesTypes annotation from the servlet spec.  If services can be
versioned, and annotations may be different between versions, we would need
some support from the jvm to be able to ensure we examine the correct
version for the target runtime jvm version.

thanks,
Jan
-- 
Jan Bartel <janb at webtide.com>
www.webtide.com
*Expert assistance from the creators of Jetty and CometD*


More information about the core-libs-dev mailing list