JVM library¶
Use the jvm/lib product type in a module to build a JVM library.
Module layout¶
Here is an overview of the module layout for a JVM library:
my-module/
├─ resources/ # (1)!
│ ╰─ logback.xml # (2)!
├─ src/
│ ├─ lib.kt
│ ╰─ Util.java # (3)!
├─ test/
│ ╰─ LibTest.java # (4)!
│ ╰─ UtilTest.kt
├─ testResources/
│ ╰─ logback-test.xml # (5)!
╰─ module.yaml
- Resources placed here are copied into the resulting JAR.
- This is just an example resource and can be omitted.
- You can mix Kotlin and Java source files in a single module, all in the
srcfolder. - You can test Java code with Kotlin tests or Kotlin code with Java tests.
- This is just an example resource and can be omitted.
Maven compatibility layout for JVM-only modules
If you're migrating from Maven, you can also configure the Maven-like layout