@@ -71,6 +71,12 @@ dependencies {
7171 // Only needs compileOnly, as the Java Client brings this as an implementation dependency.
7272 compileOnly ' com.squareup.okhttp3:okhttp:4.12.0'
7373
74+ // Automatic loading of test framework implementation dependencies is deprecated.
75+ // https://docs.gradle.org/current/userguide/upgrading_version_8.html#test_framework_implementation_dependencies
76+ // Without this, once using JUnit 5.12 or higher, Gradle will not find any tests and report an error of:
77+ // org.junit.platform.commons.JUnitException: TestEngine with ID 'junit-jupiter' failed to discover tests
78+ testRuntimeOnly " org.junit.platform:junit-platform-launcher:1.13.4"
79+
7480 testImplementation " org.apache.spark:spark-sql_2.13:${ sparkVersion} "
7581
7682 // Supports testing the embedder feature.
@@ -112,11 +118,11 @@ test {
112118 jvmArgs = [
113119 ' --add-exports=java.base/sun.nio.ch=ALL-UNNAMED' ,
114120 ' --add-exports=java.base/sun.util.calendar=ALL-UNNAMED' ,
115- ' --add-exports=java.base/sun.security.action=ALL-UNNAMED'
116- ]
121+ ' --add-exports=java.base/sun.security.action=ALL-UNNAMED' ,
117122
118- // Increased heap size as part of the Spark 4 upgrade, as we started experiencing OOM errors in the tests.
119- jvmArgs ' -Xmx6g' , ' -Xms3g'
123+ // Increased heap size as part of the Spark 4 upgrade, as we started experiencing OOM errors in the tests.
124+ ' -Xmx6g' , ' -Xms3g'
125+ ]
120126}
121127
122128shadowJar {
@@ -145,6 +151,13 @@ java {
145151 withSourcesJar()
146152}
147153
154+ // Allows for identifying compiler warnings and treating them as errors.
155+ tasks. withType(JavaCompile ) {
156+ options. compilerArgs + = [" -Xlint:unchecked" , " -Xlint:deprecation" , " -Werror" ]
157+ options. deprecation = true
158+ options. warnings = true
159+ }
160+
148161javadoc. failOnError = false
149162// Ignores warnings on params that don't have descriptions, which is a little too noisy
150163javadoc. options. addStringOption(' Xdoclint:none' , ' -quiet' )
@@ -185,17 +198,17 @@ publishing {
185198 maven {
186199 if (project. hasProperty(" mavenUser" )) {
187200 credentials {
188- username mavenUser
189- password mavenPassword
201+ username = mavenUser
202+ password = mavenPassword
190203 }
191204 url publishUrl
192205 allowInsecureProtocol = true
193206 } else {
194207 name = " central"
195208 url = mavenCentralUrl
196209 credentials {
197- username mavenCentralUsername
198- password mavenCentralPassword
210+ username = mavenCentralUsername
211+ password = mavenCentralPassword
199212 }
200213 }
201214 }
0 commit comments