Skip to content

Commit 30cf9ac

Browse files
committed
MLE-24505 More Gradle tweaks
Eliminating more warnings, and forcing an error on a compiler warning. Got rid of two systemProperty values that I don't think are needed, but we'll see what happens in the full test run.
1 parent f1542bd commit 30cf9ac

File tree

4 files changed

+32
-28
lines changed

4 files changed

+32
-28
lines changed

build.gradle

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ subprojects {
2727
mavenCentral()
2828
}
2929

30-
tasks.withType(JavaCompile) {
31-
options.encoding = 'UTF-8'
32-
options.compilerArgs += ["-Xlint:unchecked", "-Xlint:deprecation"]
30+
// Allows for identifying compiler warnings and treating them as errors.
31+
tasks.withType(JavaCompile).configureEach {
32+
options.compilerArgs += ["-Xlint:unchecked", "-Xlint:deprecation", "-Werror"]
33+
options.deprecation = true
34+
options.warnings = true
3335
}
3436

3537
tasks.withType(Test).configureEach {
@@ -38,17 +40,15 @@ subprojects {
3840
events = ['started', 'passed', 'skipped', 'failed']
3941
exceptionFormat = 'full'
4042
}
41-
42-
// Will remove this in a future PR to determine if they're needed or not.
43-
systemProperty "file.encoding", "UTF-8"
44-
systemProperty "javax.xml.stream.XMLOutputFactory", "com.sun.xml.internal.stream.XMLOutputFactoryImpl"
4543
}
4644

47-
// Until we do a cleanup of javadoc errors, the build (and specifically the javadoc task) fails on Java 11
48-
// and higher. Preventing that until the cleanup can occur.
49-
javadoc.failOnError = false
45+
tasks.withType(Javadoc).configureEach {
46+
// Until we do a cleanup of javadoc errors, the build (and specifically the javadoc task) fails on Java 11
47+
// and higher. Preventing that until the cleanup can occur.
48+
failOnError = false
5049

51-
// Ignores warnings on param tags with no descriptions. Will remove this once javadoc errors are addressed.
52-
// Until then, it's just a lot of noise.
53-
javadoc.options.addStringOption('Xdoclint:none', '-quiet')
50+
// Ignores warnings on param tags with no descriptions. Will remove this once javadoc errors are addressed.
51+
// Until then, it's just a lot of noise.
52+
options.addStringOption('Xdoclint:none', '-quiet')
53+
}
5454
}

gradle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
group=com.marklogic
22
version=8.0-SNAPSHOT
3-
describedName=MarkLogic Java Client API
43
publishUrl=file:../marklogic-java/releases
54

65
okhttpVersion=5.1.0

marklogic-client-api/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,14 @@ publishing {
140140
mainJava(MavenPublication) {
141141
from components.java
142142
pom {
143-
name = "${group}:${project.name}"
143+
name = "${project.group}:${project.name}"
144144
description = "The MarkLogic Java Client API"
145145
packaging = "jar"
146146
url = "https://github.com/marklogic/java-client-api"
147147
licenses {
148148
license {
149149
name = "The Apache License, Version 2.0"
150-
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
150+
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
151151
}
152152
}
153153
developers {
@@ -160,9 +160,9 @@ publishing {
160160
}
161161
}
162162
scm {
163-
url = "git@github.com:marklogic/java-client-api.git"
164-
connection = "scm:git:git@github.com:marklogic/java-client-api.git"
165-
developerConnection = "scm:git:git@github.com:marklogic/java-client-api.git"
163+
url = "https://github.com/marklogic/java-client-api"
164+
connection = "https://github.com/marklogic/java-client-api"
165+
developerConnection = "https://github.com/marklogic/java-client-api"
166166
}
167167
}
168168
}
@@ -174,7 +174,7 @@ publishing {
174174
username = mavenUser
175175
password = mavenPassword
176176
}
177-
url publishUrl
177+
url = publishUrl
178178
allowInsecureProtocol = true
179179
} else {
180180
name = "central"

ml-development-tools/build.gradle

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2+
13
/*
24
* Copyright (c) 2010-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
35
*/
@@ -12,6 +14,10 @@ plugins {
1214

1315
dependencies {
1416
compileOnly gradleApi()
17+
18+
// This is a runtime dependency of marklogic-client-api but is needed for compiling.
19+
compileOnly "jakarta.xml.bind:jakarta.xml.bind-api:4.0.4"
20+
1521
implementation project(':marklogic-client-api')
1622
implementation 'org.jetbrains.kotlin:kotlin-stdlib:2.1.0'
1723
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:${jacksonVersion}"
@@ -29,7 +35,7 @@ dependencies {
2935
// Added to avoid problem where processResources fails because - somehow - the plugin properties file is getting
3036
// copied twice. This started occurring with the upgrade of Gradle from 6.x to 7.x.
3137
tasks.processResources {
32-
duplicatesStrategy = "exclude"
38+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
3339
}
3440

3541
tasks.register("mlDevelopmentToolsJar", Jar) {
@@ -45,15 +51,15 @@ gradlePlugin {
4551
id = 'com.marklogic.ml-development-tools'
4652
displayName = 'ml-development-tools MarkLogic Data Service Tools'
4753
description = 'ml-development-tools plugin for developing data services on MarkLogic'
48-
tags.set(['marklogic', 'progress'])
54+
tags = ['marklogic', 'progress']
4955
implementationClass = 'com.marklogic.client.tools.gradle.ToolsPlugin'
5056
}
5157
}
5258
}
5359

5460
publishing {
5561
publications {
56-
main(MavenPublication) {
62+
mainJava(MavenPublication) {
5763
from components.java
5864
}
5965
}
@@ -70,11 +76,10 @@ publishing {
7076
}
7177
}
7278

73-
compileKotlin {
74-
kotlinOptions.jvmTarget = '17'
75-
}
76-
compileTestKotlin {
77-
kotlinOptions.jvmTarget = '17'
79+
tasks.withType(KotlinCompile).configureEach {
80+
compilerOptions {
81+
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
82+
}
7883
}
7984

8085
tasks.register("generateTests", JavaExec) {

0 commit comments

Comments
 (0)