Skip to content

Commit 3a3bbd1

Browse files
committed
MLE-24504 Bumped Jakarta and removed javax.ws
The javax.ws.rs-api dependency was only needed for a collection class that wasn't needed. Also forcing the usage of commons-lang3 as Black Duck mysteriously thinks an instance of 3.7 is being brought in as a direct dependency somehow. Also switched to latest nightly build for local testing, as Jenkins is using that too.
1 parent 5eaa965 commit 3a3bbd1

File tree

10 files changed

+218
-217
lines changed

10 files changed

+218
-217
lines changed

.copyrightconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ startyear: 2010
1111
# - Dotfiles already skipped automatically
1212
# Enable by removing the leading '# ' from the next line and editing values.
1313
# filesexcluded: third_party/*, docs/generated/*.md, assets/*.png, scripts/temp_*.py, vendor/lib.js
14-
filesexcluded: .github/*, README.md, Jenkinsfile, gradle/*, docker-compose.yml, *.gradle, gradle.properties, gradlew, gradlew.bat, **/test/resources/**, *.md
14+
filesexcluded: .github/*, README.md, Jenkinsfile, gradle/*, docker-compose.yml, *.gradle, gradle.properties, gradlew, gradlew.bat, **/test/resources/**, *.md, pom.xml

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Defines environment variables for docker-compose.
22
# Can be overridden via e.g. `MARKLOGIC_TAG=latest-10.0 docker-compose up -d --build`.
3-
MARKLOGIC_IMAGE=progressofficial/marklogic-db:latest
3+
#MARKLOGIC_IMAGE=progressofficial/marklogic-db:latest
44
MARKLOGIC_LOGS_VOLUME=./docker/marklogic/logs
55

66
# This image should be used instead of the above image when testing functions that only work with MarkLogic 12.
7-
#MARKLOGIC_IMAGE=ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic/marklogic-server-ubi:latest-12
7+
MARKLOGIC_IMAGE=ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic/marklogic-server-ubi:latest-12

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,5 @@ ml-development-tools/src/test/java/com/marklogic/client/test/dbfunction/generate
4040
docker/
4141

4242
.kotlin
43+
44+
dep.txt

build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ subprojects {
3131

3232
configurations {
3333
testImplementation.extendsFrom compileOnly
34+
35+
all {
36+
resolutionStrategy {
37+
// Forcing the latest commons-lang3 version to eliminate CVEs.
38+
force "org.apache.commons:commons-lang3:3.19.0"
39+
}
40+
}
3441
}
3542

3643
repositories {

examples/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ plugins {
66

77
dependencies {
88
implementation project(':marklogic-client-api')
9+
implementation "jakarta.xml.bind:jakarta.xml.bind-api:4.0.4"
910

1011
// The 'api' configuration is used so that the test configuration in marklogic-client-api doesn't have to declare
1112
// all of these dependencies. This library project won't otherwise be depended on by anything else as it's not

marklogic-client-api/build.gradle

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ group = 'com.marklogic'
1212
description = "The official MarkLogic Java client API."
1313

1414
dependencies {
15-
// With 7.0.0, now using the Jakarta JAXB APIs instead of the JAVAX JAXB APIs that were bundled in Java 8.
16-
// To ease support for Java 8, we are depending on version 3.x of the Jakarta JAXB APIs as those only require Java 8,
17-
// whereas the 4.x version requires Java 11 or higher.
18-
api "jakarta.xml.bind:jakarta.xml.bind-api:3.0.1"
19-
implementation "org.glassfish.jaxb:jaxb-runtime:3.0.2"
15+
// Using the latest version now that the 8.0.0 release requires Java 17.
16+
// This is now an implementation dependency as opposed to an api dependency in 7.x and earlier.
17+
// The only time it appears in the public API is when a user uses JAXBHandle.
18+
// But in that scenario, the user would already be using JAXB in their application.
19+
implementation "jakarta.xml.bind:jakarta.xml.bind-api:4.0.4"
20+
implementation "org.glassfish.jaxb:jaxb-runtime:4.0.6"
2021

2122
implementation "com.squareup.okhttp3:okhttp:${okhttpVersion}"
2223
implementation "com.squareup.okhttp3:logging-interceptor:${okhttpVersion}"
@@ -27,9 +28,10 @@ dependencies {
2728
// take 50s instead of 2 to 3s. Haven't dug into the details, but seems like the call isn't lazy and the entire set
2829
// of URIs is being retrieved. This implementation - in the old "com.sun.mail" package but still adhering to the new
2930
// jakarta.mail API - works fine and performs well for eval calls.
31+
// As of the 8.0.0 release - this still is a good solution, particularly as com.sun.mail:jakarta.mail received a
32+
// recent patch release and is therefore still being maintained.
3033
implementation "com.sun.mail:jakarta.mail:2.0.2"
3134

32-
implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1'
3335
implementation 'org.slf4j:slf4j-api:2.0.17'
3436
implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
3537
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-csv:${jacksonVersion}"

marklogic-client-api/src/main/java/com/marklogic/client/impl/RequestParametersImplementation.java

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,24 @@
33
*/
44
package com.marklogic.client.impl;
55

6+
import java.util.HashMap;
67
import java.util.List;
78
import java.util.Map;
8-
import java.util.concurrent.ConcurrentHashMap;
9-
10-
import javax.ws.rs.core.AbstractMultivaluedMap;
11-
import javax.ws.rs.core.MultivaluedMap;
129

1310
public abstract class RequestParametersImplementation {
14-
private MultivaluedMap<String, String> map =
15-
new AbstractMultivaluedMap<String,String>(new ConcurrentHashMap<>()) {};
1611

17-
protected RequestParametersImplementation() {
18-
super();
19-
}
12+
// Prior to 8.0.0, this was a threadsafe map. However, that fact was not documented for a user. And in practice,
13+
// it would not make sense for multiple threads to share a mutable instance of this, or of one of its subclasses.
14+
// Additionally, the impl was from the 'javax.ws.rs:javax.ws.rs-api:2.1.1' dependency which wasn't used for
15+
// anything else. So for 8.0.0, this is now simply a map that matches the intended usage of this class and its
16+
// subclasses, which is to be used by a single thread.
17+
private final Map<String, List<String>> map = new HashMap<>();
18+
19+
protected RequestParametersImplementation() {
20+
super();
21+
}
2022

21-
protected Map<String,List<String>> getMap() {
22-
return map;
23-
}
23+
protected Map<String, List<String>> getMap() {
24+
return map;
25+
}
2426
}

0 commit comments

Comments
 (0)