Gradle Build with Java 9 Modules and Kotlin

When starting a new Java project recently, I found it surprisingly difficult to setup the Gradle build with support for Java 9 modules and the Kotlin language.

For others who might find themselves in the same bind, here is a gist with the simplest, minimal gradle setup I came up with that includes:

  • A multi-project gradle build,
  • Java 9 modules support,
  • IntelliJ IDEA integration,
  • Kotlin language modules with support for cross-references between Java and Kotlin code in the same module.

Here is an proof-of-concept example of the above build scripts in action: https://github.com/nikolaybotevb/gradle-java9-kotlin.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.