Skip to content

Commit ee6e748

Browse files
authored
Work on #701, try to use module-info.java natively (#702)
1 parent 1328592 commit ee6e748

File tree

8 files changed

+85
-22
lines changed

8 files changed

+85
-22
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
strategy:
2424
fail-fast: false
2525
matrix:
26-
java_version: ['17', '21' ]
26+
java_version: ['17', '21', '23' ]
2727
include:
2828
- java_version: '17'
2929
release_build: 'R'

.mvn/wrapper/maven-wrapper.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
18-
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.1/maven-wrapper-3.3.1.jar
17+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
18+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar

pom.xml

+23-11
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ alternative support for serializing POJOs as XML and deserializing XML as pojos.
6565
<version>4.2.2</version>
6666
<exclusions>
6767
<exclusion>
68-
<groupId>javax.xml.stream</groupId>
69-
<artifactId>stax-api</artifactId>
68+
<groupId>javax.xml.stream</groupId>
69+
<artifactId>stax-api</artifactId>
7070
</exclusion>
7171
</exclusions>
7272
</dependency>
@@ -80,8 +80,8 @@ alternative support for serializing POJOs as XML and deserializing XML as pojos.
8080
<version>7.1.0</version>
8181
<exclusions>
8282
<exclusion>
83-
<groupId>javax.xml.stream</groupId>
84-
<artifactId>stax-api</artifactId>
83+
<groupId>javax.xml.stream</groupId>
84+
<artifactId>stax-api</artifactId>
8585
</exclusion>
8686
</exclusions>
8787
</dependency>
@@ -92,6 +92,24 @@ alternative support for serializing POJOs as XML and deserializing XML as pojos.
9292
<artifactId>junit</artifactId>
9393
<scope>test</scope>
9494
</dependency>
95+
<!-- 11-Jan-2025, joohyukkim: JSTEP-10, part 1, migrate to JUnit5 -->
96+
<!--
97+
<dependency>
98+
<groupId>org.junit.jupiter</groupId>
99+
<artifactId>junit-jupiter</artifactId>
100+
<scope>test</scope>
101+
</dependency>
102+
<dependency>
103+
<groupId>org.junit.jupiter</groupId>
104+
<artifactId>junit-jupiter-api</artifactId>
105+
<scope>test</scope>
106+
</dependency>
107+
<dependency>
108+
<groupId>org.assertj</groupId>
109+
<artifactId>assertj-core</artifactId>
110+
<scope>test</scope>
111+
</dependency>
112+
-->
95113

96114
<!-- Jakarta XMLBind (nee javax/jaxb( annotation introspector is needed BUT ONLY
97115
for tests (starting 2.13: previously compile/runtime)
@@ -115,7 +133,7 @@ alternative support for serializing POJOs as XML and deserializing XML as pojos.
115133
need, say, Sjsxp
116134
-->
117135
<!-- 11-Jan-2025, tatu: Can't properly due to missing JPMS, may re-evalute
118-
in future but for now excluded
136+
in future but for now excluded
119137
-->
120138
<!--
121139
<dependency>
@@ -125,7 +143,6 @@ alternative support for serializing POJOs as XML and deserializing XML as pojos.
125143
<scope>test</scope>
126144
</dependency>
127145
-->
128-
129146
</dependencies>
130147

131148
<!-- Alas, need to include snapshot reference since otherwise can not find
@@ -190,11 +207,6 @@ alternative support for serializing POJOs as XML and deserializing XML as pojos.
190207
</includes>
191208
</configuration>
192209
</plugin>
193-
<!-- 20-Mar-2019, tatu: use Moditect for JDK9+ module info inclusion -->
194-
<plugin>
195-
<groupId>org.moditect</groupId>
196-
<artifactId>moditect-maven-plugin</artifactId>
197-
</plugin>
198210
<!-- 05-Jul-2020, tatu: Add gradle module metadata -->
199211
<plugin>
200212
<groupId>de.jjohannes</groupId>

release-notes/VERSION

+1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ Version: 3.x (for earlier see VERSION-2.x)
1212
#540: Rename "com.fasterxml.jackson" -> "tools.jackson"
1313
#687: JSTEP-8: rename `FromXmlParser.Feature` as `XmlReadFeature`,
1414
`ToXmlGenerator.Feature` as `XmlWriteFeature`
15+
#701: Change 3.0 to use `module-info.java` directly, remove use of Moditect
1516
- Add `XmlMapper.shared()`
1617
- Minimum Java baseline: Java 17

src/moditect/module-info.java renamed to src/main/java/module-info.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
module tools.jackson.dataformat.xml {
1+
// Jackson 3.x module-info for jackson-dataformat-xml Main artifact
2+
module tools.jackson.dataformat.xml
3+
{
24
requires java.xml;
35
requires org.codehaus.stax2;
46

src/test/java/module-info.java

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Jackson 3.x module-info for jackson-dataformat-xml Test artifact
2+
module tools.jackson.dataformat.xml
3+
{
4+
// First, same requires as the main artifact
5+
6+
requires java.xml;
7+
requires org.codehaus.stax2;
8+
9+
requires com.fasterxml.jackson.annotation;
10+
requires tools.jackson.core;
11+
requires tools.jackson.databind;
12+
13+
// Then test dependencies
14+
requires junit;
15+
//requires org.junit.jupiter.api;
16+
//requires org.junit.jupiter.params;
17+
18+
requires com.ctc.wstx; // woodstox
19+
requires jakarta.xml.bind; // Jakarta-binding
20+
requires tools.jackson.module.jakarta.xmlbind;
21+
22+
// Then same exports as main artifact, but as "opens"
23+
24+
opens tools.jackson.dataformat.xml;
25+
opens tools.jackson.dataformat.xml.annotation;
26+
opens tools.jackson.dataformat.xml.deser;
27+
opens tools.jackson.dataformat.xml.ser;
28+
opens tools.jackson.dataformat.xml.util;
29+
30+
// And then additional "opens" access for tests not in packages of main
31+
32+
opens tools.jackson.dataformat.xml.adapters;
33+
opens tools.jackson.dataformat.xml.deser.builder;
34+
opens tools.jackson.dataformat.xml.deser.convert;
35+
opens tools.jackson.dataformat.xml.deser.creator;
36+
opens tools.jackson.dataformat.xml.dos;
37+
opens tools.jackson.dataformat.xml.failing;
38+
opens tools.jackson.dataformat.xml.failing.records;
39+
opens tools.jackson.dataformat.xml.fuzz;
40+
opens tools.jackson.dataformat.xml.jaxb;
41+
opens tools.jackson.dataformat.xml.incr;
42+
opens tools.jackson.dataformat.xml.jdk17;
43+
opens tools.jackson.dataformat.xml.lists;
44+
opens tools.jackson.dataformat.xml.misc;
45+
opens tools.jackson.dataformat.xml.node;
46+
opens tools.jackson.dataformat.xml.stream;
47+
opens tools.jackson.dataformat.xml.vld;
48+
opens tools.jackson.dataformat.xml.woodstox;
49+
}

src/test/java/tools/jackson/dataformat/xml/ser/dos/CyclicXMLDataSerTest.java renamed to src/test/java/tools/jackson/dataformat/xml/dos/CyclicXMLDataSerTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package tools.jackson.dataformat.xml.ser.dos;
1+
package tools.jackson.dataformat.xml.dos;
22

33
import java.util.ArrayList;
44
import java.util.List;

src/test/java/tools/jackson/dataformat/xml/failing/XmlTextViaCreator306Test.java

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
package tools.jackson.dataformat.xml.failing;
22

3-
import java.beans.ConstructorProperties;
4-
53
import com.fasterxml.jackson.annotation.JsonCreator;
4+
import com.fasterxml.jackson.annotation.JsonProperty;
65
import com.fasterxml.jackson.annotation.JsonRootName;
76

87
import tools.jackson.dataformat.xml.XmlMapper;
@@ -37,8 +36,8 @@ static class Child {
3736
@JacksonXmlText
3837
String el;
3938

40-
@ConstructorProperties({"attr", "el"})
41-
Child(String attr, String el) {
39+
@JsonCreator
40+
Child(@JsonProperty("attr") String attr, @JsonProperty("el") String el) {
4241
this.attr = attr;
4342
this.el = el;
4443
}
@@ -49,8 +48,8 @@ static class RootWithoutConstructor {
4948
@JacksonXmlProperty(localName = "CHILD")
5049
final ChildWithoutConstructor child;
5150

52-
@ConstructorProperties({"child"})
53-
public RootWithoutConstructor(ChildWithoutConstructor child) {
51+
@JsonCreator
52+
public RootWithoutConstructor(@JsonProperty("child") ChildWithoutConstructor child) {
5453
this.child = child;
5554
}
5655

0 commit comments

Comments
 (0)