Module system and services directory in META-INF

Jochen Theodorou blackdrag at gmx.org
Tue Dec 26 18:30:26 UTC 2017


hi all,

Do all files in META-INF/services now have to be well formed according 
to the SPI strucutres in Java, or is it still valid to have other files 
in there as well? Before the module system it was no problem to have in 
there service decriptors, that are services, but do not use the 
ServiceProvider structure. Nothing was disturbed as long as nobody tried 
to load it that way. Now this seems to be different and I am wondering 
where this got specified.

Because the spec does not try to define file layouts so much I have the 
feeling that this is not really specified by the java module system. Was 
it then a decision by some maven plugin writers or maybe even the javac 
guys?

We have not yet decided if we want to go with the service provider 
mechanism, because I have doubts, that unloading of service classes and 
class loaders associated with those classes will still unload if we use 
a structure as global as the service provider structure. I actually even 
fail to imagine a structure in which you can say, that at this point you 
do no longer require the services in a general and global service 
provider situation - unless there is something like an "unload". In 
other words... if you load a module dynamically, can you let it define 
services and can those services then be unloaded again?

bye Jochen


More information about the jigsaw-dev mailing list