java9-modularity / gradle-modules-plugin

This Gradle plugin helps working with the Java Platform Module System
https://javamodularity.com/
MIT License
233 stars 36 forks source link

Cannot use CompileModuleOptions with compileJava task : Extension of type 'CompileModuleOptions' does not exist. Currently registered extension types: [ExtraPropertiesExtension] #274

Open dweil opened 5 months ago

dweil commented 5 months ago

I'm trying to use tje CompileModuleOptions to add Javafx modules for test and exec task but it failed when compile gradle script. I'm using Kotlin, Java 17 and gradle 8.3. When adding the following lines to my kotlin script :

plugins {
    id("org.javamodularity.moduleplugin") version "1.8.15"
}
...
tasks.compileJava {
    extensions.configure<CompileModuleOptions> {
        addModules = listOf("jdk.jdwp.agent")
    }
}

I get the following error message Extension of type 'CompileModuleOptions' does not exist. Currently registered extension types: [ExtraPropertiesExtension]

Can