snowe
02/15/2024, 6:18 PMjvmArgs("--add-opens=java.base/java.util=ALL-UNNAMED")
, but am still getting the
Unable to make field final java.util.Map java.util.Collections$UnmodifiableMap.m accessible: module java.base does not "opens java.util" to unnamed module @4d5d943d
error.
test is pretty simple:
class CompanyIdProviderTest : FreeSpec({
"different environments result in different company ids" {
withEnvironment("ENVIRONMENT", "prod") {
System.getenv("ENVIRONMENT") shouldBe "BarValue" // System environment overridden!
}
}
})
not sure if it’s something with multimodule gradle projects or what…
tasks.withType<Test>().configureEach {
systemProperty("java.util.logging.manager", "org.jboss.logmanager.LogManager")
jvmArgs("--add-opens=java.base/java.util=ALL-UNNAMED")
}
tasks.getByName<Test>("test"){
jvmArgs("--add-opens=java.base/java.util=ALL-UNNAMED")
useJUnitPlatform() {
excludeTags("integration", "recording-api")
}
}
LeoColman
02/15/2024, 7:14 PMLeoColman
02/15/2024, 7:14 PMsnowe
02/15/2024, 8:38 PMsnowe
02/15/2024, 10:07 PMsnowe
02/15/2024, 10:08 PMsnowe
02/15/2024, 10:45 PMEmil Kantis
02/15/2024, 10:45 PMsnowe
02/15/2024, 10:46 PMsnowe
02/15/2024, 10:46 PMEmil Kantis
02/15/2024, 10:50 PMsnowe
02/15/2024, 10:56 PMEmil Kantis
02/15/2024, 10:58 PMEmil Kantis
02/15/2024, 10:58 PMEmil Kantis
02/15/2024, 10:59 PMsnowe
02/15/2024, 10:59 PMEmil Kantis
02/15/2024, 11:01 PMEmil Kantis
02/15/2024, 11:01 PMsnowe
02/15/2024, 11:02 PMEmil Kantis
02/15/2024, 11:02 PMsnowe
02/15/2024, 11:03 PMsnowe
02/15/2024, 11:03 PMCLOVIS
02/19/2024, 9:08 AMjvmArgs("--add-opens", "java.base/java.util=ALL-UNNAMED")
It mirrors the CLI syntax, in which both are separated by a space (exactly like they would be split in argv
)
I recommend setting it in the Gradle build and avoiding changing the IntelliJ run configuration as much as possible, because the run configuration doesn't impact your CI, while your Gradle config does 🙂Emil Kantis
02/19/2024, 9:50 AM