Skip to content

Commit f10a1fa

Browse files
committed
MLE-15728 Now depending on Jakarta JAXB
Will update the README later with instructions on how to force the client to use Jakarta 4.x instead of Jakarta 3.x. No real functional changes here, just changing from `javax.xml` to `jakarta.xml`. But it's a breaking change due to JAXB APIs being present in the public API of classes like `JAXBHandle`.
1 parent a4f561f commit f10a1fa

File tree

55 files changed

+114
-175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+114
-175
lines changed

README.md

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -51,61 +51,7 @@ Full documentation is available at:
5151

5252
## Including JAXB support
5353

54-
If you are using Java 11 or higher (including Java 17) and you wish to use [JAXB](https://docs.oracle.com/javase/tutorial/jaxb/intro/)
55-
with the client, you'll need to include JAXB API and implementation dependencies as those are no
56-
longer included in Java 11 and higher.
57-
58-
For Maven, include the following in your pom.xml file:
59-
60-
<dependency>
61-
<groupId>javax.xml.bind</groupId>
62-
<artifactId>jaxb-api</artifactId>
63-
<version>2.3.1</version>
64-
</dependency>
65-
<dependency>
66-
<groupId>org.glassfish.jaxb</groupId>
67-
<artifactId>jaxb-runtime</artifactId>
68-
<version>2.3.2</version>
69-
</dependency>
70-
<dependency>
71-
<groupId>org.glassfish.jaxb</groupId>
72-
<artifactId>jaxb-core</artifactId>
73-
<version>2.3.0.1</version>
74-
</dependency>
75-
76-
For Gradle, include the following in your build.gradle file (this can be included in the same `dependencies` block
77-
as the one that includes the marklogic-client-api dependency):
78-
79-
dependencies {
80-
implementation "javax.xml.bind:jaxb-api:2.3.1"
81-
implementation "org.glassfish.jaxb:jaxb-runtime:2.3.2"
82-
implementation "org.glassfish.jaxb:jaxb-core:2.3.0.1"
83-
}
84-
85-
You are free to use any implementation of JAXB that you wish, but you need to ensure that you're using a JAXB
86-
implementation that corresponds to the `javax.xml.bind` interfaces. JAXB 3.0 and 4.0 interfaces are packaged under
87-
`jakarta.xml.bind`, and the Java API does not yet depend on those interfaces.
88-
89-
Thus, you are free to include an implementation of JAXB 3.0 or 4.0 in your project for your own use; it will not
90-
affect the Java API. A caveat though is if you are trying to use different major versions of the same JAXB
91-
implementation library - such as `org.glassfish.jaxb:jaxb-runtime` - then you will run into an expected dependency
92-
conflict between the two versions of the library. This can be worked around by using a different implementation of
93-
JAXB 3.0 or JAXB 4.0 - for example:
94-
95-
dependencies {
96-
// JAXB 2 dependencies required by Java Client
97-
implementation "javax.xml.bind:jaxb-api:2.3.1"
98-
implementation "org.glassfish.jaxb:jaxb-runtime:2.3.2"
99-
implementation "org.glassfish.jaxb:jaxb-core:2.3.0.1"
100-
101-
// JAXB 4 dependencies required by other application code
102-
implementation "jakarta.xml.bind:jakarta.xml.bind-api:4.0.0"
103-
implementation "com.sun.xml.bind:jaxb-impl:4.0.1"
104-
}
105-
106-
The client will soon be updated to use the newer `jakarta.xml.bind` interfaces. Until then, the above approach
107-
or one similar to it will allow for both the old and new JAXB interfaces and implementations to exist together in the
108-
same classpath.
54+
TODO, Need to rewrite this for Java Client 7.0.0.
10955

11056
## Support
11157

examples/build.gradle

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ plugins {
55
}
66

77
dependencies {
8-
if (JavaVersion.current().isJava9Compatible()) {
9-
implementation 'javax.xml.bind:jaxb-api:2.3.1'
10-
implementation 'org.glassfish.jaxb:jaxb-runtime:2.3.2'
11-
implementation 'org.glassfish.jaxb:jaxb-core:2.3.0.1'
12-
}
138
implementation project(':marklogic-client-api')
149

1510
// Forcing usage of 3.4.0 instead of 3.2.0 to address vulnerability - https://security.snyk.io/vuln/SNYK-JAVA-COMSQUAREUPOKIO-5820002

examples/src/main/java/com/marklogic/client/example/cookbook/AllCookbookExamples.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import java.io.IOException;
1919

20-
import javax.xml.bind.JAXBException;
20+
import jakarta.xml.bind.JAXBException;
2121
import javax.xml.xpath.XPathExpressionException;
2222

2323
import com.marklogic.client.FailedRequestException;

examples/src/main/java/com/marklogic/client/example/cookbook/JAXBDocument.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818
import java.io.IOException;
1919

20-
import javax.xml.bind.JAXBContext;
21-
import javax.xml.bind.JAXBException;
22-
import javax.xml.bind.annotation.XmlRootElement;
20+
import jakarta.xml.bind.JAXBContext;
21+
import jakarta.xml.bind.JAXBException;
22+
import jakarta.xml.bind.annotation.XmlRootElement;
2323

2424
import com.marklogic.client.DatabaseClient;
2525
import com.marklogic.client.DatabaseClientFactory;

examples/src/main/java/com/marklogic/client/example/cookbook/datamovement/DatabaseClientSingleton.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import java.text.SimpleDateFormat;
2020
import java.util.HashMap;
2121

22-
import javax.xml.bind.JAXBException;
22+
import jakarta.xml.bind.JAXBException;
2323

2424
import com.marklogic.client.DatabaseClient;
2525
import com.marklogic.client.DatabaseClientFactory;

examples/src/main/java/com/marklogic/client/example/cookbook/datamovement/WriteandReadPOJOs.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
*/
1616
package com.marklogic.client.example.cookbook.datamovement;
1717

18-
import javax.xml.bind.JAXBException;
19-
import javax.xml.bind.annotation.XmlRootElement;
18+
import jakarta.xml.bind.JAXBException;
19+
import jakarta.xml.bind.annotation.XmlRootElement;
2020

2121
import org.slf4j.Logger;
2222
import org.slf4j.LoggerFactory;
@@ -53,7 +53,7 @@ public static void main(String args[]) throws JAXBException {
5353

5454
/**
5555
* A sample class which we will be using in order to demonstrate
56-
* reading and writing large number of POJOs
56+
* reading and writing large number of POJOs
5757
*/
5858
@XmlRootElement
5959
public static class ProductDetails {
@@ -136,7 +136,7 @@ public void readBulkPOJOS() throws JAXBException {
136136
// Create a query definition in order to use it with QueryBatcher
137137
StructuredQueryDefinition query = new StructuredQueryBuilder().collection("products-collection1");
138138

139-
// Create a QueryBatcher in order to retrieve bulk POJOs
139+
// Create a QueryBatcher in order to retrieve bulk POJOs
140140
// from the database matching the query definition
141141
QueryBatcher queryBatcher = moveMgr.newQueryBatcher(query)
142142
.withBatchSize(batchSize)

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group=com.marklogic
2-
version=6.7-SNAPSHOT
2+
version=7.0-SNAPSHOT
33
describedName=MarkLogic Java Client API
44
publishUrl=file:../marklogic-java/releases
55

marklogic-client-api-functionaltests/build.gradle

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,7 @@ dependencies {
2727
implementation 'com.fasterxml.jackson.core:jackson-core:2.15.3'
2828
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.3'
2929
implementation "org.jdom:jdom2:2.0.6.1"
30-
implementation "com.marklogic:ml-app-deployer:4.6.1"
31-
32-
if (JavaVersion.current().isJava9Compatible()) {
33-
implementation 'javax.xml.bind:jaxb-api:2.3.1'
34-
implementation 'org.glassfish.jaxb:jaxb-runtime:2.3.8'
35-
implementation 'org.glassfish.jaxb:jaxb-core:2.3.0.1'
36-
}
30+
implementation "com.marklogic:ml-app-deployer:4.7.0"
3731

3832
testImplementation 'ch.qos.logback:logback-classic:1.3.14'
3933
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'

marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/TestBulkWriteSample1.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import static org.junit.jupiter.api.Assertions.*;
3030
import org.skyscreamer.jsonassert.JSONAssert;
3131

32-
import javax.xml.bind.JAXBContext;
32+
import jakarta.xml.bind.JAXBContext;
3333
import javax.xml.transform.Source;
3434
import javax.xml.transform.dom.DOMSource;
3535
import java.io.*;

marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/TestMetadata.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import static org.junit.jupiter.api.Assertions.*;
3535
import org.skyscreamer.jsonassert.JSONAssert;
3636

37-
import javax.xml.bind.JAXBException;
37+
import jakarta.xml.bind.JAXBException;
3838
import javax.xml.namespace.QName;
3939
import java.io.File;
4040
import java.io.FileInputStream;

0 commit comments

Comments
 (0)