Skip to content

Commit a8a4d40

Browse files
committed
MLE-24402 Bumping to Hadoop 3.4.2
This is to match Flux, which is depending on Hadoop 3.4.2. Also fixed all compiler warnings, so enabling those as errors now.
1 parent 09f0cf1 commit a8a4d40

File tree

3 files changed

+29
-16
lines changed

3 files changed

+29
-16
lines changed

build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,16 @@ subprojects {
3636
repositories {
3737
mavenCentral()
3838
maven {
39-
url "https://bed-artifactory.bedford.progress.com:443/artifactory/ml-maven-snapshots/"
39+
url = "https://bed-artifactory.bedford.progress.com:443/artifactory/ml-maven-snapshots/"
4040
}
4141
}
4242

4343
configurations.all {
4444
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
45+
if (details.requested.group.equals("org.apache.hadoop") and details.requested.version.equals("3.4.1")) {
46+
details.useVersion "3.4.2"
47+
details.because "Using 3.4.2 to minimize CVEs and because Flux is doing the same thing. This only affects the connector tests."
48+
}
4549
if (details.requested.group.startsWith('com.fasterxml.jackson')) {
4650
details.useVersion '2.17.2'
4751
details.because 'Need to match the version used by Spark.'
@@ -79,16 +83,12 @@ subprojects {
7983
exclude module: "rocksdbjni"
8084
}
8185

82-
task allDeps(type: DependencyReportTask) {
83-
description = "Allows for generating dependency reports for every subproject in a single task."
84-
}
85-
8686
test {
8787
useJUnitPlatform()
8888
finalizedBy jacocoTestReport
8989
testLogging {
90-
events 'started', 'passed', 'skipped', 'failed'
91-
exceptionFormat 'full'
90+
events = ['started', 'passed', 'skipped', 'failed']
91+
exceptionFormat = 'full'
9292
}
9393
environment "SEMAPHORE_API_KEY", semaphoreApiKey
9494
environment "SEMAPHORE_HOST", semaphoreHost

marklogic-spark-connector/build.gradle

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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

122128
shadowJar {
@@ -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+
148161
javadoc.failOnError = false
149162
// Ignores warnings on params that don't have descriptions, which is a little too noisy
150163
javadoc.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
}

marklogic-spark-connector/src/test/java/com/marklogic/spark/AbstractIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ protected final String rowsToString(List<Row> rows) {
139139
/**
140140
* Avoids having to repeat mode/save.
141141
*/
142-
protected void defaultWrite(DataFrameWriter writer) {
142+
protected void defaultWrite(DataFrameWriter<?> writer) {
143143
writer.options(defaultWriteOptions())
144144
.mode(SaveMode.Append)
145145
.save();

0 commit comments

Comments
 (0)