diff --git a/build.gradle b/build.gradle deleted file mode 100644 index ad346b41..00000000 --- a/build.gradle +++ /dev/null @@ -1,283 +0,0 @@ -/* - * Copyright 2019 Aiven Oy and http-connector-for-apache-kafka project contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -plugins { - // https://docs.gradle.org/current/userguide/java_library_plugin.html - id 'java-library' - - // https://docs.gradle.org/current/userguide/distribution_plugin.html - id 'distribution' - - // https://docs.gradle.org/current/userguide/checkstyle_plugin.html - id 'checkstyle' - - // https://docs.gradle.org/current/userguide/idea_plugin.html - id 'idea' - - // https://plugins.gradle.org/plugin/nebula.lint - id "nebula.lint" version "19.0.1" - - // https://plugins.gradle.org/plugin/com.github.spotbugs - id "com.github.spotbugs" version "6.0.7" - - // https://plugins.gradle.org/plugin/com.diffplug.gradle.spotless - id "com.diffplug.spotless" version "6.25.0" -} - -repositories { - mavenCentral() - maven { - url "https://packages.confluent.io/maven" - } -} - -sourceCompatibility = JavaVersion.VERSION_11 -targetCompatibility = JavaVersion.VERSION_11 - -wrapper { - distributionType = 'ALL' - doLast { - def sha256Sum = new String(new URL("${distributionUrl}.sha256").bytes) - propertiesFile << "distributionSha256Sum=${sha256Sum}\n" - println "Added checksum to wrapper properties" - } -} - -ext { - moduleName = "io.aiven.kafka.connect.http" - - avroVersion = "1.9.2" // Version 1.9.2 brings Jackson 2.10.2 package for Avro - confluentPlatformVersion = "6.0.2" // For compatibility tests use version 6.0.2 to match Kafka 2.6. - // NOTE: Confluent Platform v6.0.3 has a dependency mismatch issue. - hamcrestVersion = "2.2" - jacksonVersion = "2.16.1" // This Jackson is used in the tests. - jupiterVersion = "5.10.1" - kafkaVersion = '2.6.3' - jettyVersion = "9.4.51.v20230217" - junit4Version = "4.13.2" - jsr305Version = "3.0.2" - log4jVersion = "2.20.0" - mockitoVersion = '5.6.0' - servletVersion = "4.0.1" - slf4japiVersion = "1.7.36" - spotbugsAnnotationsVersion = "4.7.3" - testcontainersVersion = '1.19.0' - assertjVersion = "3.25.2" - awaitilityVersion = "4.2.0" -} - -distributions { - main { - contents { - from jar - from configurations.runtimeClasspath - } - } -} - -sourceSets { - integrationTest { - java.srcDir file('src/integration-test/java') - resources.srcDir file('src/integration-test/resources') - compileClasspath += sourceSets.main.output + configurations.testRuntimeClasspath - runtimeClasspath += output + compileClasspath - } -} - -idea { - module { - testSources.from(sourceSets.integrationTest.java.srcDirs) - testSources.from(sourceSets.integrationTest.resources.srcDirs) - } -} - -configurations { - integrationTestImplementation.extendsFrom testImplementation - integrationTestRuntimeOnly.extendsFrom testRuntimeOnly -} - -dependencies { - compileOnly "org.apache.kafka:connect-api:$kafkaVersion" - compileOnly "org.apache.kafka:connect-json:$kafkaVersion" - compileOnly "org.apache.kafka:kafka-clients:$kafkaVersion" - - // For Spotbugs suppressions - compileOnly "com.github.spotbugs:spotbugs-annotations:$spotbugsAnnotationsVersion" - compileOnly "com.google.code.findbugs:jsr305:$jsr305Version" - - implementation "com.fasterxml.jackson.core:jackson-core:$jacksonVersion" - implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion" - implementation "org.slf4j:slf4j-api:$slf4japiVersion" - - testRuntimeOnly "org.apache.kafka:connect-json:$kafkaVersion" - testRuntimeOnly "org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion" - testRuntimeOnly "org.junit.jupiter:junit-jupiter:$jupiterVersion" - - testImplementation "org.apache.kafka:connect-api:$kafkaVersion" - testImplementation "org.junit.jupiter:junit-jupiter-api:$jupiterVersion" - testImplementation "org.junit.jupiter:junit-jupiter-params:$jupiterVersion" - testImplementation "org.mockito:mockito-core:$mockitoVersion" - testImplementation "org.mockito:mockito-junit-jupiter:$mockitoVersion" - testImplementation "org.assertj:assertj-core:$assertjVersion" - - integrationTestRuntimeOnly "io.confluent:kafka-avro-serializer:$confluentPlatformVersion" - integrationTestRuntimeOnly "io.confluent:kafka-connect-avro-converter:$confluentPlatformVersion" - integrationTestRuntimeOnly "io.confluent:kafka-json-serializer:$confluentPlatformVersion" - integrationTestRuntimeOnly "org.junit.jupiter:junit-jupiter:$jupiterVersion" - integrationTestRuntimeOnly "org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion" - - integrationTestImplementation "org.apache.kafka:connect-runtime:$kafkaVersion" - integrationTestImplementation "com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion" - integrationTestImplementation "javax.servlet:javax.servlet-api:$servletVersion" - integrationTestImplementation "org.apache.avro:avro:$avroVersion" - integrationTestImplementation "org.apache.kafka:connect-runtime:$kafkaVersion" - integrationTestImplementation "org.eclipse.jetty:jetty-http:$jettyVersion" - integrationTestImplementation "org.eclipse.jetty:jetty-server:$jettyVersion" - integrationTestImplementation "org.eclipse.jetty:jetty-util:$jettyVersion" - integrationTestImplementation "junit:junit:$junit4Version" // This is for testcontainers - integrationTestImplementation "org.testcontainers:junit-jupiter:$testcontainersVersion" - integrationTestImplementation "org.testcontainers:kafka:$testcontainersVersion" // this is not Kafka version - integrationTestImplementation "org.testcontainers:testcontainers:$testcontainersVersion" - integrationTestImplementation "org.awaitility:awaitility:$awaitilityVersion" - - // Make test utils from 'test' available in 'integration-test' - integrationTestImplementation sourceSets.test.output -} - -checkstyle { - toolVersion '10.12.0' -} - -compileJava { - // Enable modules. - inputs.property('moduleName', moduleName) - doFirst { - options.compilerArgs = [ - '--module-path', classpath.asPath - ] - classpath = files() - } -} - -test { - useJUnitPlatform { - includeEngines 'junit-jupiter' - } -} - -tasks.register('integrationTest', Test) { - description = 'Runs the integration tests.' - group = 'verification' - testClassesDirs = sourceSets.integrationTest.output.classesDirs - classpath = sourceSets.integrationTest.runtimeClasspath - - // defines testing order - shouldRunAfter test - // requires archive for connect runner - dependsOn distTar - - useJUnitPlatform() - - // Run always. - outputs.upToDateWhen { false } - - // Pass the distribution file path to the tests. - systemProperty("integration-test.distribution.file.path", distTar.archiveFile.get().asFile.path) -} - -tasks.javadoc { - // disable missing javadoc lint and show only warning and error messages - options.addStringOption('Xdoclint:all,-missing', '-quiet') -} - -processResources { - filesMatching('http-connector-for-apache-kafka-version.properties') { - expand(version: version) - } -} - -jar { - manifest { - attributes( - 'Version': "${getArchiveVersion().get()}" - ) - } -} - -tasks.register('connectorConfigDoc') { - description = "Generates the connector's configuration documentation." - group = "documentation" - dependsOn "classes" - - doLast { - javaexec { - main = "io.aiven.kafka.connect.http.config.HttpSinkConfig" - classpath = sourceSets.main.runtimeClasspath + sourceSets.main.compileClasspath - standardOutput = new FileOutputStream("$projectDir/docs/sink-connector-config-options.rst") - } - } -} - -spotless { - format "xml", { - target "**/*.xml" - targetExclude ".*/**", "gradle/wrapper/**" - eclipseWtp("xml").configFile("${project.rootDir}/config/spotless-eclipse-wtp-xml.prefs") - endWithNewline() - } - - format "misc", { - target "**/*.gradle", "**/*.md", "**/*.properties" - targetExclude ".*/**", "gradle/wrapper/**" - endWithNewline() - indentWithSpaces() - trimTrailingWhitespace() - } -} - -spotbugs { - toolVersion = "4.7.3" - excludeFilter = file("${project.rootDir}/config/spotbugs-exclude.xml") -} -spotbugsMain { - reports { - html { - enabled = true - stylesheet = 'fancy-hist.xsl' - } - } -} -spotbugsTest { - reports { - html { - enabled = true - stylesheet = 'fancy-hist.xsl' - } - } -} -spotbugsIntegrationTest { - reports { - html { - enabled = true - stylesheet = 'fancy-hist.xsl' - } - } -} - -gradleLint.alwaysRun = false -gradleLint { - rules = ['all-dependency'] -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 00000000..a0fdabc5 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,248 @@ +import com.diffplug.spotless.extra.wtp.EclipseWtpFormatterStep +import com.github.spotbugs.snom.SpotBugsTask +import java.io.FileOutputStream +import java.net.URL + +/* + * Copyright 2019 Aiven Oy and http-connector-for-apache-kafka project contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +plugins { + // https://docs.gradle.org/current/userguide/java_library_plugin.html + `java-library` + + // https://docs.gradle.org/current/userguide/distribution_plugin.html + distribution + + // https://docs.gradle.org/current/userguide/checkstyle_plugin.html + checkstyle + + // https://docs.gradle.org/current/userguide/idea_plugin.html + idea + + // https://plugins.gradle.org/plugin/com.github.spotbugs + id("com.github.spotbugs") version "6.0.7" + + // https://plugins.gradle.org/plugin/com.diffplug.gradle.spotless + id("com.diffplug.spotless") version "6.25.0" +} + +repositories { + mavenCentral() + maven("https://packages.confluent.io/maven") +} + +java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} + +tasks.wrapper { + distributionType = Wrapper.DistributionType.ALL + doLast { + val sha256Sum = URL("$distributionUrl.sha256").readText() + propertiesFile.appendText("distributionSha256Sum=${sha256Sum}\n") + println("Added checksum to wrapper properties") + } +} + +val moduleName = "io.aiven.kafka.connect.http" + +val avroVersion = "1.9.2" // Version 1.9.2 brings Jackson 2.10.2 package for Avro +val confluentPlatformVersion = "6.0.2" // For compatibility tests use version 6.0.2 to match Kafka 2.6. +// NOTE: Confluent Platform v6.0.3 has a dependency mismatch issue. +val hamcrestVersion = "2.2" +val jacksonVersion = "2.16.1" // This Jackson is used in the tests. +val jupiterVersion = "5.10.1" +val kafkaVersion = "2.6.3" +val jettyVersion = "9.4.51.v20230217" +val junit4Version = "4.13.2" +val jsr305Version = "3.0.2" +val log4jVersion = "2.20.0" +val mockitoVersion = "5.10.0" +val servletVersion = "4.0.1" +val slf4japiVersion = "1.7.36" +val spotbugsAnnotationsVersion = "4.8.2" +val testcontainersVersion = "1.19.4" +val assertjVersion = "3.25.2" +val awaitilityVersion = "4.2.0" + +distributions { + named("main") { + contents { + from(tasks.jar) + from(configurations.runtimeClasspath) + } + } +} + +sourceSets { + create("integrationTest") { + java.srcDir(file("src/integration-test/java")) + resources.srcDir(file("src/integration-test/resources")) + compileClasspath += sourceSets.main.get().output + configurations.testRuntimeClasspath.get() + runtimeClasspath += output + compileClasspath + } +} + +idea { + module { + testSources.from(project.sourceSets["integrationTest"].java.srcDirs) + testSources.from(project.sourceSets["integrationTest"].resources.srcDirs) + } +} + +val integrationTestImplementation: Configuration by configurations.getting { + extendsFrom(configurations["testImplementation"]) +} + +val integrationTestRuntimeOnly: Configuration by configurations.getting { + extendsFrom(configurations["testRuntimeOnly"]) +} + +dependencies { + compileOnly("org.apache.kafka:connect-api:$kafkaVersion") + compileOnly("org.apache.kafka:connect-json:$kafkaVersion") + compileOnly("org.apache.kafka:kafka-clients:$kafkaVersion") + + // For Spotbugs suppressions + compileOnly("com.github.spotbugs:spotbugs-annotations:$spotbugsAnnotationsVersion") + compileOnly("com.google.code.findbugs:jsr305:$jsr305Version") + + implementation("com.fasterxml.jackson.core:jackson-core:$jacksonVersion") + implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion") + implementation("org.slf4j:slf4j-api:$slf4japiVersion") + + testRuntimeOnly("org.apache.kafka:connect-json:$kafkaVersion") + testRuntimeOnly("org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion") + testRuntimeOnly("org.junit.jupiter:junit-jupiter:$jupiterVersion") + + testImplementation("org.apache.kafka:connect-api:$kafkaVersion") + testImplementation("org.junit.jupiter:junit-jupiter-api:$jupiterVersion") + testImplementation("org.junit.jupiter:junit-jupiter-params:$jupiterVersion") + testImplementation("org.mockito:mockito-core:$mockitoVersion") + testImplementation("org.mockito:mockito-junit-jupiter:$mockitoVersion") + testImplementation("org.assertj:assertj-core:$assertjVersion") + + integrationTestRuntimeOnly("io.confluent:kafka-avro-serializer:$confluentPlatformVersion") + integrationTestRuntimeOnly("io.confluent:kafka-connect-avro-converter:$confluentPlatformVersion") + integrationTestRuntimeOnly("io.confluent:kafka-json-serializer:$confluentPlatformVersion") + integrationTestRuntimeOnly("org.junit.jupiter:junit-jupiter:$jupiterVersion") + integrationTestRuntimeOnly("org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion") + + integrationTestImplementation("org.apache.kafka:connect-runtime:$kafkaVersion") + integrationTestImplementation("com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion") + integrationTestImplementation("javax.servlet:javax.servlet-api:$servletVersion") + integrationTestImplementation("org.apache.avro:avro:$avroVersion") + integrationTestImplementation("org.apache.kafka:connect-runtime:$kafkaVersion") + integrationTestImplementation("org.eclipse.jetty:jetty-http:$jettyVersion") + integrationTestImplementation("org.eclipse.jetty:jetty-server:$jettyVersion") + integrationTestImplementation("org.eclipse.jetty:jetty-util:$jettyVersion") + integrationTestImplementation("junit:junit:$junit4Version") // This is for testcontainers + integrationTestImplementation("org.testcontainers:junit-jupiter:$testcontainersVersion") + integrationTestImplementation("org.testcontainers:kafka:$testcontainersVersion") // this is not Kafka version + integrationTestImplementation("org.testcontainers:testcontainers:$testcontainersVersion") + integrationTestImplementation("org.awaitility:awaitility:$awaitilityVersion") + + // Make test utils from "test" available in "integration-test" + integrationTestImplementation(sourceSets["test"].output) +} + +checkstyle { + toolVersion = "8.25" +} + +tasks.compileJava { + inputs.property("moduleName", moduleName) + doFirst { + options.compilerArgs = listOf("--module-path", classpath.asPath) + classpath = files() + } +} + +tasks { + create("integrationTest", Test::class) { + description = "Runs the integration tests." + group = "verification" + testClassesDirs = sourceSets["integrationTest"].output.classesDirs + classpath = sourceSets["integrationTest"].runtimeClasspath + dependsOn("test", "distTar") + useJUnitPlatform() + outputs.upToDateWhen { false } + systemProperty("integration-test.distribution.file.path", distTar.get().archiveFile.get().asFile.path) + } +} + +tasks.test { + useJUnitPlatform { + includeEngines("junit-jupiter") + } +} + +tasks.processResources { + filesMatching("http-connector-for-apache-kafka-version.properties") { + expand(mapOf("version" to version)) + } +} + +tasks.jar { + manifest { + attributes(mapOf("Version" to archiveVersion.get())) + } +} + +tasks.register("connectorConfigDoc") { + description = "Generates the connector's configuration documentation." + group = "documentation" + dependsOn("classes") + doLast { + project.javaexec { + mainClass = "io.aiven.kafka.connect.http.config.HttpSinkConfig" + classpath = sourceSets.main.get().runtimeClasspath + sourceSets.main.get().compileClasspath + standardOutput = FileOutputStream("$projectDir/docs/sink-connector-config-options.rst") + } + } +} + +spotless { + format("xml") { + target("**/*.xml") + targetExclude(".*/**", "gradle/wrapper/**") + eclipseWtp(EclipseWtpFormatterStep.XML).configFile("${project.rootDir}/config/spotless-eclipse-wtp-xml.prefs") + endWithNewline() + } + + format("misc") { + target("**/*.gradle", "**/*.md", "**/*.properties") + targetExclude(".*/**", "gradle/wrapper/**") + endWithNewline() + indentWithSpaces() + trimTrailingWhitespace() + } + kotlinGradle { + ktlint() + } +} + +spotbugs { + toolVersion = "4.8.3" + excludeFilter = file("${project.rootDir}/config/spotbugs-exclude.xml") +} +tasks.withType().configureEach { + reports.create("html") { + required = true + setStylesheet("fancy-hist.xsl") + } +} diff --git a/docs/sink-connector-config-options.rst b/docs/sink-connector-config-options.rst index f0cdcfea..5a905367 100644 --- a/docs/sink-connector-config-options.rst +++ b/docs/sink-connector-config-options.rst @@ -190,7 +190,7 @@ Delivery The time in milliseconds to wait following an error before a retry attempt is made. * Type: int - * Default: 3000 + * Default: 3000 (3 seconds) * Valid Values: [0,...] * Importance: medium @@ -205,4 +205,14 @@ Timeout * Valid Values: [1,...] * Importance: low +Errors Handling +^^^^^^^^^^^^^^^ + +``errors.tolerance`` + Optional errors.tolerance setting. Defaults to "none". + + * Type: string + * Default: null + * Importance: low + diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 41d9927a..d64cd491 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ece8b00a..e554d847 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,8 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionSha256Sum=5625a0ae20fe000d9225d000b36909c7a0e0e8dda61c19b12da769add847c975 +distributionSha256Sum=85719317abd2112f021d4f41f09ec370534ba288432065f4b477b6a3b652910d diff --git a/gradlew b/gradlew index 1b6c7873..1aa94a42 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +80,11 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,22 +131,29 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,11 +198,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ @@ -205,6 +214,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/gradlew.bat b/gradlew.bat index ac1b06f9..7101f8e4 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,13 +41,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 08ba9124..00000000 --- a/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'http-connector-for-apache-kafka' diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 00000000..6b76db6c --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1 @@ +rootProject.name = "http-connector-for-apache-kafka" diff --git a/src/main/java/io/aiven/kafka/connect/http/config/HttpSinkConfig.java b/src/main/java/io/aiven/kafka/connect/http/config/HttpSinkConfig.java index 5abd7f3e..38604513 100644 --- a/src/main/java/io/aiven/kafka/connect/http/config/HttpSinkConfig.java +++ b/src/main/java/io/aiven/kafka/connect/http/config/HttpSinkConfig.java @@ -37,7 +37,7 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -public class HttpSinkConfig extends AbstractConfig { +public final class HttpSinkConfig extends AbstractConfig { private static final String CONNECTION_GROUP = "Connection"; private static final String HTTP_URL_CONFIG = "http.url"; private static final String HTTP_PROXY_HOST = "http.proxy.host";