kite-sdk / kite

Kite SDK
http://kitesdk.org/docs/current/
Apache License 2.0
394 stars 262 forks source link

importCommands using globs does not with with Java9 #469

Open hossman opened 7 years ago

hossman commented 7 years ago

the "importCommands" parsing code for dealing with prefix based globs (ie: org.kitesdk.** or com.foo.morphlines.*) Doesn't work using Java9.

This seems to be because the underlying classpath scanning is build on the ClassPath.from(ClassLoader) API shadded from Guava, which has a very notable limitation documented...

* <p>Currently only {@link URLClassLoader} and only {@code file://} urls are supported.

...but in Java9, URLClassLoader is (aparently) rarely used as a result of the new (jigsaw) module system.

The only work around seems to be to change all morphlines configs to remove * globs from importCommands declarations and enumate every CommandBuilder implemenation needed for the config.

I suggest morphlines switch to using SPI based scanning for CommandBuilders since that is a good API for plugins that has been supported by the JVM for a looooong time, and continues to work in Java9.

See also: https://issues.apache.org/jira/browse/SOLR-8876