Yes. But. The current content breaks the expected semantics of the
ServiceLoader mechanism.
That is, a line in a file such as META-INF/services/com.acme.Foo, is
expected to be
- a fully classified classname
- with no-args constructor
- that implements (if the filename denotes an interface) or extends (if
the filename denotes a class) the target type.
Per these rules the content of
META-INF/services/org.codehaus.groovy.source.Extensions
is wrong.
Given that this metadata file is to be used by the Groovy compiler alone it
would be better to use a different path/naming convention that does not
clash with existing Java conventions, something like
META-INF/groovy/org.codehaus.groovy.source.Extensions
Unless I missed something this should work, shouldn't it?
Cheers,
Andres
-------------------------------------------
Java Champion; Groovy Enthusiast
JCP EC Associate Seat
http://andresalmiray.com
http://www.linkedin.com/in/aalmiray
--
What goes up, must come down. Ask any system administrator.
There are 10 types of people in the world: Those who understand binary, and
those who don't.
To understand recursion, we must first understand recursion.
On Sun, Dec 3, 2017 at 12:01 PM, Cédric Champeau <[email protected]>
wrote:
> This file is used by Groovy internally, there's no reason for the JDK to
> interpret its contents since it has only a meaning for Groovy. In short, it
> declares the list of extensions recognized by the Groovy compiler. That it
> prevents loading as a module is rather strange.
>
> 2017-12-03 16:37 GMT+01:00 Ceki Gulcu <[email protected]>:
>
>> Hi all,
>>
>> Referring to a discussion on the maven users list [1], it appears that
>> removing the file META-INF/services/org.codehaus.groovy.source.Extensions
>> from groovy-2.4.13.jar allows Java 9 to successfully load groovy-2.4.13.jar
>> as an auto-module.
>>
>> The org.codehaus.groovy.source.Extensions file contains the lone word
>> "groovy" instead of a fully qualified class name.
>>
>> Please advise.
>>
>> Best regards,
>>
>> --
>> Ceki Gülcü
>>
>> [1] http://markmail.org/message/obdyvuv24kqpxm6v
>>
>
>