From ef15629be1124909fa8215cb9498b8efdd678fbf Mon Sep 17 00:00:00 2001 From: Christian Ortlepp Date: Mon, 27 Nov 2023 15:17:46 +0100 Subject: [PATCH] fix: plugin publish and update dependencies --- build.gradle.kts | 14 +++++++------- detekt.yml | 2 +- .../tasks/solrCloud/AbstractSolrAdminTask.kt | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 01b986f..959c273 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -24,7 +24,7 @@ plugins { `java-gradle-plugin` groovy - kotlin("jvm") version "1.9.20" + kotlin("jvm") version "1.9.21" // test coverage jacoco @@ -48,10 +48,10 @@ plugins { id("org.jetbrains.dokka") version "1.9.10" // code analysis for kotlin - id("io.gitlab.arturbosch.detekt") version "1.18.0" + id("io.gitlab.arturbosch.detekt") version "1.23.4" // plugin for publishing to Gradle Portal - id("com.gradle.plugin-publish") version "1.0.0" + id("com.gradle.plugin-publish") version "1.2.1" } scm { @@ -122,7 +122,6 @@ gradlePlugin { } } } - java { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 @@ -134,8 +133,8 @@ if (project.version.toString().endsWith("-SNAPSHOT")) { } detekt { - source = files("src/main/kotlin") - config = files("detekt.yml") + source.setFrom(files("src/main/kotlin")) + config.setFrom(files("detekt.yml")) } val shaded by configurations.creating @@ -309,12 +308,13 @@ dependencies { implementation(gradleKotlinDsl()) - implementation("org.apache.solr:solr-solrj:8.11.2") + implementation("org.apache.solr:solr-solrj:9.4.0") implementation("com.bmuschko:gradle-docker-plugin:8.1.0") implementation("com.intershop.gradle.icm:icm-gradle-plugin:5.8.0") implementation("com.intershop.gradle.jobrunner:icmjobrunner:1.0.5") testImplementation("com.intershop.gradle.test:test-gradle-plugin:4.1.2") testImplementation(gradleTestKit()) + detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.4") } diff --git a/detekt.yml b/detekt.yml index 9907499..9505f52 100644 --- a/detekt.yml +++ b/detekt.yml @@ -213,7 +213,7 @@ exceptions: - RuntimeException formatting: - active: true + active: false android: false autoCorrect: true AnnotationOnSeparateLine: diff --git a/src/main/kotlin/com/intershop/gradle/icm/docker/tasks/solrCloud/AbstractSolrAdminTask.kt b/src/main/kotlin/com/intershop/gradle/icm/docker/tasks/solrCloud/AbstractSolrAdminTask.kt index 7d70c7c..9fa08cf 100644 --- a/src/main/kotlin/com/intershop/gradle/icm/docker/tasks/solrCloud/AbstractSolrAdminTask.kt +++ b/src/main/kotlin/com/intershop/gradle/icm/docker/tasks/solrCloud/AbstractSolrAdminTask.kt @@ -26,6 +26,7 @@ import org.gradle.api.provider.Property import org.gradle.api.tasks.Input import org.gradle.api.tasks.Internal import org.gradle.api.tasks.options.Option +import java.util.concurrent.TimeUnit import javax.inject.Inject abstract class AbstractSolrAdminTask @Inject constructor(objectFactory: ObjectFactory) : DefaultTask() { @@ -64,7 +65,7 @@ abstract class AbstractSolrAdminTask @Inject constructor(objectFactory: ObjectFa } - private fun getClient(connectStr: String):CloudSolrClient { + private fun getClient(connectStr: String): CloudSolrClient { val pathList = connectStr.split("/") val path = if (pathList.size > 1) { @@ -74,9 +75,8 @@ abstract class AbstractSolrAdminTask @Inject constructor(objectFactory: ObjectFa } val zkHosts = pathList[0].split(";") - val client = CloudSolrClient.Builder(zkHosts, path).build() - client.setZkConnectTimeout(connectionTimeout.get()) - - return client + return CloudSolrClient.Builder(zkHosts, path) + .withZkConnectTimeout(connectionTimeout.get(), TimeUnit.MILLISECONDS) + .build() } }