Skip to content

Commit

Permalink
feat(java): Update Java to version 21 (#420)
Browse files Browse the repository at this point in the history
  • Loading branch information
HorizonNet authored Dec 6, 2023
1 parent 95152e6 commit 8d141f4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .java-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
17.0.9
21.0.1
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ group 'com.ultratendency.kafka.ldap'
version '2.1.1' // x-release-please-version

java {
sourceCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
}

test {
Expand Down Expand Up @@ -75,10 +75,10 @@ configurations.all {
}

compileKotlin {
kotlinOptions.jvmTarget = JavaVersion.VERSION_17.toString()
kotlinOptions.jvmTarget = JavaVersion.VERSION_21.toString()
}
compileTestKotlin {
kotlinOptions.jvmTarget = JavaVersion.VERSION_17.toString()
kotlinOptions.jvmTarget = JavaVersion.VERSION_21.toString()
}

test {
Expand Down
5 changes: 3 additions & 2 deletions src/main/kotlin/com/ultratendency/kafka/ldap/LDAPConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.fasterxml.jackson.module.kotlin.KotlinFeature
import com.fasterxml.jackson.module.kotlin.KotlinModule
import org.slf4j.LoggerFactory
import java.lang.IllegalArgumentException
import java.net.URI
import java.net.URL
import java.nio.file.FileSystemNotFoundException
import java.nio.file.Files
Expand Down Expand Up @@ -57,7 +58,7 @@ object LDAPConfig {
init {
cache =
try {
loadConfig(ClassLoader.getSystemResource("ldapconfig.yaml") ?: URL(""))
loadConfig(ClassLoader.getSystemResource("ldapconfig.yaml") ?: URI("").toURL())
.also {
log.info("LDAPConfig for classpath is cached")
log.info("ldap configuration values: $it")
Expand All @@ -70,7 +71,7 @@ object LDAPConfig {

fun getBySource(configFile: String): Config {
val prefix = if (System.getProperty("os.name").startsWith("Windows")) "file:/" else "file:"
return loadConfig(URL(prefix + System.getProperty("user.dir") + "/" + configFile))
return loadConfig(URI(prefix + System.getProperty("user.dir") + "/" + configFile).toURL())
}

fun getByClasspath(): Config = cache
Expand Down

0 comments on commit 8d141f4

Please sign in to comment.