diff --git a/build.gradle b/build.gradle index a87d5146e..887eb4302 100644 --- a/build.gradle +++ b/build.gradle @@ -27,9 +27,11 @@ subprojects { mavenCentral() } - tasks.withType(JavaCompile) { - options.encoding = 'UTF-8' - options.compilerArgs += ["-Xlint:unchecked", "-Xlint:deprecation"] + // Allows for identifying compiler warnings and treating them as errors. + tasks.withType(JavaCompile).configureEach { + options.compilerArgs += ["-Xlint:unchecked", "-Xlint:deprecation", "-Werror"] + options.deprecation = true + options.warnings = true } tasks.withType(Test).configureEach { @@ -38,17 +40,15 @@ subprojects { events = ['started', 'passed', 'skipped', 'failed'] exceptionFormat = 'full' } - - // Will remove this in a future PR to determine if they're needed or not. - systemProperty "file.encoding", "UTF-8" - systemProperty "javax.xml.stream.XMLOutputFactory", "com.sun.xml.internal.stream.XMLOutputFactoryImpl" } - // Until we do a cleanup of javadoc errors, the build (and specifically the javadoc task) fails on Java 11 - // and higher. Preventing that until the cleanup can occur. - javadoc.failOnError = false + tasks.withType(Javadoc).configureEach { + // Until we do a cleanup of javadoc errors, the build (and specifically the javadoc task) fails on Java 11 + // and higher. Preventing that until the cleanup can occur. + failOnError = false - // Ignores warnings on param tags with no descriptions. Will remove this once javadoc errors are addressed. - // Until then, it's just a lot of noise. - javadoc.options.addStringOption('Xdoclint:none', '-quiet') + // Ignores warnings on param tags with no descriptions. Will remove this once javadoc errors are addressed. + // Until then, it's just a lot of noise. + options.addStringOption('Xdoclint:none', '-quiet') + } } diff --git a/gradle.properties b/gradle.properties index 60f18ae19..62b1ed3dd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,5 @@ group=com.marklogic version=8.0-SNAPSHOT -describedName=MarkLogic Java Client API publishUrl=file:../marklogic-java/releases okhttpVersion=5.1.0 diff --git a/marklogic-client-api/build.gradle b/marklogic-client-api/build.gradle index 47372a6aa..b100e5a91 100644 --- a/marklogic-client-api/build.gradle +++ b/marklogic-client-api/build.gradle @@ -140,14 +140,14 @@ publishing { mainJava(MavenPublication) { from components.java pom { - name = "${group}:${project.name}" + name = "${project.group}:${project.name}" description = "The MarkLogic Java Client API" packaging = "jar" url = "https://github.com/marklogic/java-client-api" licenses { license { name = "The Apache License, Version 2.0" - url = "http://www.apache.org/licenses/LICENSE-2.0.txt" + url = "https://www.apache.org/licenses/LICENSE-2.0.txt" } } developers { @@ -160,9 +160,9 @@ publishing { } } scm { - url = "git@github.com:marklogic/java-client-api.git" - connection = "scm:git:git@github.com:marklogic/java-client-api.git" - developerConnection = "scm:git:git@github.com:marklogic/java-client-api.git" + url = "https://github.com/marklogic/java-client-api" + connection = "https://github.com/marklogic/java-client-api" + developerConnection = "https://github.com/marklogic/java-client-api" } } } @@ -174,7 +174,7 @@ publishing { username = mavenUser password = mavenPassword } - url publishUrl + url = publishUrl allowInsecureProtocol = true } else { name = "central" diff --git a/ml-development-tools/build.gradle b/ml-development-tools/build.gradle index 847a98b9c..5eeead94a 100644 --- a/ml-development-tools/build.gradle +++ b/ml-development-tools/build.gradle @@ -1,3 +1,5 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + /* * Copyright (c) 2010-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved. */ @@ -12,6 +14,10 @@ plugins { dependencies { compileOnly gradleApi() + + // This is a runtime dependency of marklogic-client-api but is needed for compiling. + compileOnly "jakarta.xml.bind:jakarta.xml.bind-api:4.0.4" + implementation project(':marklogic-client-api') implementation 'org.jetbrains.kotlin:kotlin-stdlib:2.1.0' implementation "com.fasterxml.jackson.module:jackson-module-kotlin:${jacksonVersion}" @@ -29,7 +35,7 @@ dependencies { // Added to avoid problem where processResources fails because - somehow - the plugin properties file is getting // copied twice. This started occurring with the upgrade of Gradle from 6.x to 7.x. tasks.processResources { - duplicatesStrategy = "exclude" + duplicatesStrategy = DuplicatesStrategy.EXCLUDE } tasks.register("mlDevelopmentToolsJar", Jar) { @@ -45,7 +51,7 @@ gradlePlugin { id = 'com.marklogic.ml-development-tools' displayName = 'ml-development-tools MarkLogic Data Service Tools' description = 'ml-development-tools plugin for developing data services on MarkLogic' - tags.set(['marklogic', 'progress']) + tags = ['marklogic', 'progress'] implementationClass = 'com.marklogic.client.tools.gradle.ToolsPlugin' } } @@ -53,7 +59,7 @@ gradlePlugin { publishing { publications { - main(MavenPublication) { + mainJava(MavenPublication) { from components.java } } @@ -70,11 +76,10 @@ publishing { } } -compileKotlin { - kotlinOptions.jvmTarget = '17' -} -compileTestKotlin { - kotlinOptions.jvmTarget = '17' +tasks.withType(KotlinCompile).configureEach { + compilerOptions { + jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17) + } } tasks.register("generateTests", JavaExec) {