Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work on #701, try to use module-info.java natively #702

Merged
merged 9 commits into from
Jan 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java_version: ['17', '21' ]
java_version: ['17', '21', '23' ]
include:
- java_version: '17'
release_build: 'R'
4 changes: 2 additions & 2 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -14,5 +14,5 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.1/maven-wrapper-3.3.1.jar
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar
34 changes: 23 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -65,8 +65,8 @@ alternative support for serializing POJOs as XML and deserializing XML as pojos.
<version>4.2.2</version>
<exclusions>
<exclusion>
<groupId>javax.xml.stream</groupId>
<artifactId>stax-api</artifactId>
<groupId>javax.xml.stream</groupId>
<artifactId>stax-api</artifactId>
</exclusion>
</exclusions>
</dependency>
@@ -80,8 +80,8 @@ alternative support for serializing POJOs as XML and deserializing XML as pojos.
<version>7.1.0</version>
<exclusions>
<exclusion>
<groupId>javax.xml.stream</groupId>
<artifactId>stax-api</artifactId>
<groupId>javax.xml.stream</groupId>
<artifactId>stax-api</artifactId>
</exclusion>
</exclusions>
</dependency>
@@ -92,6 +92,24 @@ alternative support for serializing POJOs as XML and deserializing XML as pojos.
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<!-- 11-Jan-2025, joohyukkim: JSTEP-10, part 1, migrate to JUnit5 -->
<!--
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
-->

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

</dependencies>

<!-- 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.
</includes>
</configuration>
</plugin>
<!-- 20-Mar-2019, tatu: use Moditect for JDK9+ module info inclusion -->
<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
</plugin>
<!-- 05-Jul-2020, tatu: Add gradle module metadata -->
<plugin>
<groupId>de.jjohannes</groupId>
1 change: 1 addition & 0 deletions release-notes/VERSION
Original file line number Diff line number Diff line change
@@ -12,5 +12,6 @@ Version: 3.x (for earlier see VERSION-2.x)
#540: Rename "com.fasterxml.jackson" -> "tools.jackson"
#687: JSTEP-8: rename `FromXmlParser.Feature` as `XmlReadFeature`,
`ToXmlGenerator.Feature` as `XmlWriteFeature`
#701: Change 3.0 to use `module-info.java` directly, remove use of Moditect
- Add `XmlMapper.shared()`
- Minimum Java baseline: Java 17
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module tools.jackson.dataformat.xml {
// Jackson 3.x module-info for jackson-dataformat-xml Main artifact
module tools.jackson.dataformat.xml
{
requires java.xml;
requires org.codehaus.stax2;

49 changes: 49 additions & 0 deletions src/test/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Jackson 3.x module-info for jackson-dataformat-xml Test artifact
module tools.jackson.dataformat.xml
{
// First, same requires as the main artifact

requires java.xml;
requires org.codehaus.stax2;

requires com.fasterxml.jackson.annotation;
requires tools.jackson.core;
requires tools.jackson.databind;

// Then test dependencies
requires junit;
//requires org.junit.jupiter.api;
//requires org.junit.jupiter.params;

requires com.ctc.wstx; // woodstox
requires jakarta.xml.bind; // Jakarta-binding
requires tools.jackson.module.jakarta.xmlbind;

// Then same exports as main artifact, but as "opens"

opens tools.jackson.dataformat.xml;
opens tools.jackson.dataformat.xml.annotation;
opens tools.jackson.dataformat.xml.deser;
opens tools.jackson.dataformat.xml.ser;
opens tools.jackson.dataformat.xml.util;

// And then additional "opens" access for tests not in packages of main

opens tools.jackson.dataformat.xml.adapters;
opens tools.jackson.dataformat.xml.deser.builder;
opens tools.jackson.dataformat.xml.deser.convert;
opens tools.jackson.dataformat.xml.deser.creator;
opens tools.jackson.dataformat.xml.dos;
opens tools.jackson.dataformat.xml.failing;
opens tools.jackson.dataformat.xml.failing.records;
opens tools.jackson.dataformat.xml.fuzz;
opens tools.jackson.dataformat.xml.jaxb;
opens tools.jackson.dataformat.xml.incr;
opens tools.jackson.dataformat.xml.jdk17;
opens tools.jackson.dataformat.xml.lists;
opens tools.jackson.dataformat.xml.misc;
opens tools.jackson.dataformat.xml.node;
opens tools.jackson.dataformat.xml.stream;
opens tools.jackson.dataformat.xml.vld;
opens tools.jackson.dataformat.xml.woodstox;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tools.jackson.dataformat.xml.ser.dos;
package tools.jackson.dataformat.xml.dos;

import java.util.ArrayList;
import java.util.List;
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package tools.jackson.dataformat.xml.failing;

import java.beans.ConstructorProperties;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;

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

@ConstructorProperties({"attr", "el"})
Child(String attr, String el) {
@JsonCreator
Child(@JsonProperty("attr") String attr, @JsonProperty("el") String el) {
this.attr = attr;
this.el = el;
}
@@ -49,8 +48,8 @@ static class RootWithoutConstructor {
@JacksonXmlProperty(localName = "CHILD")
final ChildWithoutConstructor child;

@ConstructorProperties({"child"})
public RootWithoutConstructor(ChildWithoutConstructor child) {
@JsonCreator
public RootWithoutConstructor(@JsonProperty("child") ChildWithoutConstructor child) {
this.child = child;
}