zyxist / chainsaw

Gradle plugin: adds support for building Java 9 modules.
Apache License 2.0
70 stars 4 forks source link

Possibility to put libs to the classpath #26

Open Vampire opened 6 years ago

Vampire commented 6 years ago

Please provide the possibility to have libs non-transitively on the classpath that will not end up on the module path. In my concrete situation we use com.github.sarxos:webcam-capture:0.3.12 which depends on com.nativelibs4java:bridj:0.7.0. bridj tries to load resources from other modules via Class#getResource and if that fails it tries to use ClassLoader#getResource. The latter would work properly as it is an automatic module and tries to get a resource from an automatic module, but unfortunatley there is a bug in bridj that makes the class loader part break (they do not strip the leading slash of the path). This is (besides fixing the bug) only solvable by removing bridj from the module path and adding it to the classpath instead, as unnamed modules do not have the restriction automatic and named modules have, that Class#getResource only works for resources within the own module.