zyxist / chainsaw

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

Support for custom `--add-opens` flags #8

Closed zyxist closed 6 years ago

zyxist commented 6 years ago

Guice 4.2 relies on cglib library, which makes an illegal reflection access to java.lang module. If we try to run Guice-based application with Gradle and Chainsaw, we get an error from JVM that java.base does not open java.lang to com.google.guice.

It seems that there is no good solution for that at the Guice side, until Guice fully migrates to Jigsaw and cglib is fixed. To deal with it, we must add the following CLI flag: --add-opens=java.base/java.lang=com.google.guice. Currently, there is no way to configure such custom flags via Chainsaw.