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

[WIP] Try with jaxb 3.0 and xjc #7161

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
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
14 changes: 8 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ dependencies {

implementation 'de.undercouch:citeproc-java:2.1.0-SNAPSHOT'

implementation group: 'jakarta.activation', name: 'jakarta.activation-api', version: '1.2.1'
implementation group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api', version: '2.3.2'
implementation group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '2.3.2'
implementation group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api', version: '3.0.0'
implementation group: 'com.sun.xml.bind', name: 'jaxb-core', version: '3.0.0'
implementation group: 'com.sun.xml.bind', name: 'jaxb-impl', version: '3.0.0'

implementation ('com.github.tomtung:latex2unicode_2.12:0.2.6') {
exclude module: 'fastparse_2.12'
Expand Down Expand Up @@ -208,7 +208,8 @@ dependencies {
testImplementation "org.hamcrest:hamcrest-library:2.2"

checkstyle 'com.puppycrawl.tools:checkstyle:8.38'
xjc group: 'org.glassfish.jaxb', name: 'jaxb-xjc', version: '2.3.3'
xjc group: 'com.sun.xml.bind', name: 'jaxb-xjc', version: '3.0.0'
xjc group: 'com.sun.xml.bind', name: 'jaxb-impl', version: '3.0.0'
}

dependencyUpdates {
Expand Down Expand Up @@ -561,7 +562,6 @@ jlink {
// Execute ./gradlew suggestMergedModuleInfo and include the suggested directives here.
mergedModule {
requires 'java.xml'
requires 'com.sun.xml.txw2'
requires 'java.desktop'
requires 'org.objectweb.asm'
requires 'jdk.jfr'
Expand Down Expand Up @@ -590,6 +590,8 @@ jlink {
requires 'java.transaction.xa'
requires 'org.graalvm.sdk'
requires 'org.slf4j'
requires 'jakarta.xml.bind';
requires 'jakarta.activation';
uses 'org.apache.logging.log4j.util.PropertySource'
uses 'org.apache.logging.log4j.core.util.WatchEventService'
uses 'org.apache.logging.log4j.plugins.processor.PluginService'
Expand All @@ -603,7 +605,7 @@ jlink {
uses 'org.mariadb.jdbc.credential.CredentialPlugin'
uses 'org.mariadb.jdbc.tls.TlsSocketPlugin'
uses 'org.mariadb.jdbc.LocalInfileInterceptor'
uses 'javax.xml.bind.JAXBContextFactory'
uses 'jakarta.xml.bind.JAXBContextFactory'
provides 'javax.annotation.processing.Processor' with 'org.apache.logging.log4j.plugins.processor.PluginProcessor'
provides 'org.controlsfx.glyphfont.GlyphFont' with 'org.controlsfx.glyphfont.FontAwesome'
provides 'org.apache.logging.log4j.message.ThreadDumpMessage.ThreadInfoFactory' with 'org.apache.logging.log4j.core.message.ExtendedThreadInfoFactory'
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

// Preferences and XML
requires java.prefs;
requires java.xml.bind;
requires jakarta.xml.bind;
requires jdk.xml.dom;

// Annotations (@PostConstruct)
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/jabref/logic/exporter/BibTeXMLExporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
import java.util.Optional;
import java.util.stream.Collectors;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
Expand Down Expand Up @@ -47,6 +43,10 @@
import org.jabref.model.entry.types.EntryType;
import org.jabref.model.entry.types.StandardEntryType;

import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.Marshaller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
9 changes: 5 additions & 4 deletions src/main/java/org/jabref/logic/exporter/ModsExporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
import java.util.Objects;
import java.util.TreeMap;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.namespace.QName;

import org.jabref.logic.importer.fileformat.mods.AbstractDefinition;
Expand Down Expand Up @@ -52,6 +48,11 @@
import org.jabref.model.entry.field.UnknownField;
import org.jabref.model.entry.types.EntryType;

import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.Marshaller;

/**
* TemplateExporter for exporting in MODS XML format.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
import java.util.Optional;
import java.util.regex.Pattern;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.datatype.XMLGregorianCalendar;

import org.jabref.logic.importer.Importer;
Expand All @@ -34,6 +30,10 @@
import org.jabref.model.entry.field.StandardField;
import org.jabref.model.entry.types.StandardEntryType;

import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.Unmarshaller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
import java.util.Optional;
import java.util.stream.Collectors;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
Expand Down Expand Up @@ -58,6 +55,9 @@
import org.jabref.model.strings.StringUtil;
import org.jabref.model.util.OptionalUtil;

import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.Unmarshaller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
import java.util.Objects;
import java.util.Optional;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
Expand Down Expand Up @@ -84,6 +80,10 @@
import org.jabref.model.strings.StringUtil;

import com.google.common.base.Joiner;
import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.Unmarshaller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
import java.util.regex.Pattern;
import java.util.stream.Collectors;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;

import org.jabref.logic.importer.ImportFormatPreferences;
import org.jabref.logic.importer.Importer;
import org.jabref.logic.importer.ParseException;
Expand Down Expand Up @@ -63,6 +58,10 @@
import org.jabref.model.entry.types.EntryTypeFactory;

import com.google.common.base.Joiner;
import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.Unmarshaller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

// This needs to be in the src/main/java to ensure that the Namespace is mapped to the prefix "mods"
// this cannot be done by a gradle task at the moment
@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.loc.gov/mods/v3", xmlns = {
@XmlNs(prefix = "mods", namespaceURI = "http://www.loc.gov/mods/v3")}, elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
@jakarta.xml.bind.annotation.XmlSchema(namespace = "http://www.loc.gov/mods/v3", xmlns = {
@XmlNs(prefix = "mods", namespaceURI = "http://www.loc.gov/mods/v3")}, elementFormDefault = jakarta.xml.bind.annotation.XmlNsForm.QUALIFIED)
package org.jabref.logic.importer.fileformat.mods;

import javax.xml.bind.annotation.XmlNs;
import jakarta.xml.bind.annotation.XmlNs;
2 changes: 1 addition & 1 deletion src/main/resources/xjc/mods/mods-binding.xjb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<jxb:bindings version="2.0" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<jxb:bindings version="3.0" xmlns:jxb="https://jakarta.ee/xml/ns/jaxb" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<jxb:bindings schemaLocation="mods-3-7.xsd" node="/xsd:schema">

Expand Down