Jakarta EE 9 migration
Upgrades many dependency declarations; removes old EJB 2.x support and outdated Servlet-based integrations (Commons FileUpload, FreeMarker JSP support, Tiles). Closes gh-22093 Closes gh-25354 Closes gh-26185 Closes gh-27423 See gh-27424
This commit is contained in:
@@ -20,11 +20,11 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlEnum;
|
||||
import javax.xml.bind.annotation.XmlRegistry;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlSeeAlso;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import jakarta.xml.bind.annotation.XmlEnum;
|
||||
import jakarta.xml.bind.annotation.XmlRegistry;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
import jakarta.xml.bind.annotation.XmlSeeAlso;
|
||||
import jakarta.xml.bind.annotation.XmlType;
|
||||
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -38,22 +38,7 @@ import java.util.Date;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.activation.DataHandler;
|
||||
import javax.activation.DataSource;
|
||||
import javax.xml.XMLConstants;
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBElement;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.MarshalException;
|
||||
import javax.xml.bind.Marshaller;
|
||||
import javax.xml.bind.UnmarshalException;
|
||||
import javax.xml.bind.Unmarshaller;
|
||||
import javax.xml.bind.ValidationEventHandler;
|
||||
import javax.xml.bind.ValidationException;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.adapters.XmlAdapter;
|
||||
import javax.xml.bind.attachment.AttachmentMarshaller;
|
||||
import javax.xml.bind.attachment.AttachmentUnmarshaller;
|
||||
import javax.xml.datatype.Duration;
|
||||
import javax.xml.datatype.XMLGregorianCalendar;
|
||||
import javax.xml.namespace.QName;
|
||||
@@ -70,6 +55,21 @@ import javax.xml.transform.stream.StreamSource;
|
||||
import javax.xml.validation.Schema;
|
||||
import javax.xml.validation.SchemaFactory;
|
||||
|
||||
import jakarta.activation.DataHandler;
|
||||
import jakarta.activation.DataSource;
|
||||
import jakarta.xml.bind.JAXBContext;
|
||||
import jakarta.xml.bind.JAXBElement;
|
||||
import jakarta.xml.bind.JAXBException;
|
||||
import jakarta.xml.bind.MarshalException;
|
||||
import jakarta.xml.bind.Marshaller;
|
||||
import jakarta.xml.bind.UnmarshalException;
|
||||
import jakarta.xml.bind.Unmarshaller;
|
||||
import jakarta.xml.bind.ValidationEventHandler;
|
||||
import jakarta.xml.bind.ValidationException;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
import jakarta.xml.bind.annotation.adapters.XmlAdapter;
|
||||
import jakarta.xml.bind.attachment.AttachmentMarshaller;
|
||||
import jakarta.xml.bind.attachment.AttachmentUnmarshaller;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.w3c.dom.ls.LSResourceResolver;
|
||||
@@ -275,11 +275,11 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi
|
||||
* <p>These properties will be set on the underlying JAXB {@code Marshaller},
|
||||
* and allow for features such as indentation.
|
||||
* @param properties the properties
|
||||
* @see javax.xml.bind.Marshaller#setProperty(String, Object)
|
||||
* @see javax.xml.bind.Marshaller#JAXB_ENCODING
|
||||
* @see javax.xml.bind.Marshaller#JAXB_FORMATTED_OUTPUT
|
||||
* @see javax.xml.bind.Marshaller#JAXB_NO_NAMESPACE_SCHEMA_LOCATION
|
||||
* @see javax.xml.bind.Marshaller#JAXB_SCHEMA_LOCATION
|
||||
* @see jakarta.xml.bind.Marshaller#setProperty(String, Object)
|
||||
* @see jakarta.xml.bind.Marshaller#JAXB_ENCODING
|
||||
* @see jakarta.xml.bind.Marshaller#JAXB_FORMATTED_OUTPUT
|
||||
* @see jakarta.xml.bind.Marshaller#JAXB_NO_NAMESPACE_SCHEMA_LOCATION
|
||||
* @see jakarta.xml.bind.Marshaller#JAXB_SCHEMA_LOCATION
|
||||
*/
|
||||
public void setMarshallerProperties(Map<String, ?> properties) {
|
||||
this.marshallerProperties = properties;
|
||||
@@ -289,7 +289,7 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi
|
||||
* Set the JAXB {@code Unmarshaller} properties.
|
||||
* <p>These properties will be set on the underlying JAXB {@code Unmarshaller}.
|
||||
* @param properties the properties
|
||||
* @see javax.xml.bind.Unmarshaller#setProperty(String, Object)
|
||||
* @see jakarta.xml.bind.Unmarshaller#setProperty(String, Object)
|
||||
*/
|
||||
public void setUnmarshallerProperties(Map<String, ?> properties) {
|
||||
this.unmarshallerProperties = properties;
|
||||
@@ -409,7 +409,7 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi
|
||||
|
||||
/**
|
||||
* Specify a JAXB mapped class for partial unmarshalling.
|
||||
* @see javax.xml.bind.Unmarshaller#unmarshal(javax.xml.transform.Source, Class)
|
||||
* @see jakarta.xml.bind.Unmarshaller#unmarshal(javax.xml.transform.Source, Class)
|
||||
*/
|
||||
public void setMappedClass(Class<?> mappedClass) {
|
||||
this.mappedClass = mappedClass;
|
||||
@@ -574,7 +574,7 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // on JDK 9
|
||||
@SuppressWarnings("deprecation")
|
||||
private Schema loadSchema(Resource[] resources, String schemaLanguage) throws IOException, SAXException {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Setting validation schema to " +
|
||||
@@ -857,7 +857,7 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // on JDK 9
|
||||
@SuppressWarnings("deprecation")
|
||||
private Source processSource(Source source) {
|
||||
if (StaxUtils.isStaxSource(source) || source instanceof DOMSource) {
|
||||
return source;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.oxm.mime;
|
||||
|
||||
import javax.activation.DataHandler;
|
||||
import jakarta.activation.DataHandler;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user