Skip to content

Commit

Permalink
Change dependencies to Jakarta EE libraries (#1605)
Browse files Browse the repository at this point in the history
* Remove Jersey dependency and migrate WPS WSDL functionality to ResourcesServlet

* update namespace to be compliant with jaxb v3

* replace javax dependecies with jakarta for jaxb usage

* fix formatting

* * replace javax with jakarta dependencies
* replace maven-jaxb2-plugin with jaxb-maven-plugin

* * change more javax.activation and javax.soap to jakarta

* * fix axiom/soap related issues of jakarta migration

* * remove javax.* form exceptions of banDuplicateClasses
+ add banned dependencies for javax.xml.bind javax.activation

* - remove JAXB references from main pom

* * fix axiom issues

* * move to older jakarta.activation-api 1.2.2 (which includes still javax.activation packages)

* * include javax.activation and jakarta.activation

* * fix dependency versions

* * fiex deegree-protocol-wms tests

* * fix oracle to use correct jaxb package
* fix logging

* * fixed formatting

* * fix more dependency issues
- remove obsolete stuff from pom.xml

---------

Co-authored-by: Dirk Stenger <stenger@lat-lon.de>
Co-authored-by: Kevin van den Bosch <kevin.van.den.bosch@idgis.nl>
  • Loading branch information
3 people committed Dec 1, 2023
1 parent b69536b commit 1fbb503
Show file tree
Hide file tree
Showing 178 changed files with 414 additions and 382 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
----------------------------------------------------------------------------*/
package org.deegree.client.core.validator;

import jakarta.activation.MimetypesFileTypeMap;
import java.util.ArrayList;
import java.util.List;

import javax.activation.MimetypesFileTypeMap;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

import static org.deegree.client.core.utils.MessageUtils.getFacesMessage;

import jakarta.annotation.PostConstruct;
import java.io.Serializable;
import java.net.MalformedURLException;
import java.net.URL;
Expand All @@ -45,7 +46,6 @@
import java.util.Locale;
import java.util.Map;

import javax.annotation.PostConstruct;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
Expand Down
4 changes: 2 additions & 2 deletions deegree-core/deegree-connectionprovider-datasource/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<build>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:jdbc="http://www.deegree.org/jdbc" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
targetNamespace="http://www.deegree.org/connectionprovider/datasource" elementFormDefault="qualified" jaxb:version="2.1">
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:jdbc="http://www.deegree.org/jdbc" xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb"
targetNamespace="http://www.deegree.org/connectionprovider/datasource" elementFormDefault="qualified" jaxb:version="3.0">
<annotation>
<appinfo>
<jaxb:schemaBindings>
Expand Down
4 changes: 2 additions & 2 deletions deegree-core/deegree-core-3d/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<build>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-->
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.deegree.org/datasource/3d/batchedmt/file" elementFormDefault="qualified"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.1">
xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb" jaxb:version="3.0">
<annotation>
<appinfo>
<jaxb:schemaBindings>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-->
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:file="http://www.deegree.org/datasource/renderable/file"
xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.deegree.org/datasource/3d/renderable/file"
elementFormDefault="qualified" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.1">
elementFormDefault="qualified" xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb" jaxb:version="3.0">
<annotation>
<appinfo>
<jaxb:schemaBindings>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-->
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.deegree.org/datasource/3d/renderable/sql" elementFormDefault="qualified"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.1">
xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb" jaxb:version="3.0">
<annotation>
<appinfo>
<jaxb:schemaBindings>
Expand Down
21 changes: 15 additions & 6 deletions deegree-core/deegree-core-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<build>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand All @@ -30,8 +30,12 @@
<artifactId>jakarta.xml.bind-api</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
</dependency>
<dependency>
<groupId>jakarta.activation</groupId>
<artifactId>jakarta.activation-api</artifactId>
</dependency>
<dependency>
<groupId>org.deegree</groupId>
Expand All @@ -46,6 +50,11 @@
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-impl</artifactId>
</dependency>
<!-- javax.activation for axiom only (until migrated to jakarta) -->
<dependency>
<groupId>com.sun.activation</groupId>
<artifactId>jakarta.activation</artifactId>
</dependency>
<dependency>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-api</artifactId>
Expand All @@ -55,8 +64,8 @@
<artifactId>FastInfoset</artifactId>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<groupId>jakarta.mail</groupId>
<artifactId>jakarta.mail-api</artifactId>
</dependency>
<dependency>
<groupId>jaxen</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@
import java.util.List;
import java.util.Properties;

import javax.mail.Message;
import javax.mail.Multipart;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
import jakarta.mail.Message;
import jakarta.mail.Multipart;
import jakarta.mail.Session;
import jakarta.mail.Transport;
import jakarta.mail.internet.InternetAddress;
import jakarta.mail.internet.MimeBodyPart;
import jakarta.mail.internet.MimeMessage;
import jakarta.mail.internet.MimeMultipart;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -57,8 +57,8 @@
* A helper class to create and send mail.
*
* @author <a href="mailto:tfr@users.sourceforge.net">Torsten Friebe </A>
* @see javax.mail.Message
* @see javax.mail.internet.MimeMessage
* @see jakarta.mail.Message
* @see jakarta.mail.internet.MimeMessage
*/

public final class MailHelper {
Expand Down Expand Up @@ -121,7 +121,7 @@ public static void createAndSendMail(MailMessage eMess, String mailHost, File[]
* @param session
* @throws SendMailException an exception if the message is undeliverable
*
* @see javax.mail.Transport
* @see jakarta.mail.Transport
* @see <a href=
* "http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Resources4.html#63060">J2EE Mail
* Session connection </a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
package org.deegree.commons.tom.datetime;

import static java.util.Calendar.getInstance;
import static javax.xml.bind.DatatypeConverter.printDateTime;
import static jakarta.xml.bind.DatatypeConverter.printDateTime;

import java.util.Calendar;
import java.util.TimeZone;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.xml.bind.DatatypeConverter;
import jakarta.xml.bind.DatatypeConverter;

/**
* Converts between <a href="http://en.wikipedia.org/wiki/ISO_8601">ISO 8601:2004</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import static javax.xml.stream.XMLStreamConstants.CHARACTERS;
import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
import static org.apache.axiom.om.OMXMLBuilderFactory.createStAXOMBuilder;
import static org.deegree.commons.utils.net.HttpUtils.STREAM;
import static org.deegree.commons.utils.net.HttpUtils.get;

Expand All @@ -58,24 +59,22 @@
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.StringTokenizer;

import javax.xml.namespace.NamespaceContext;
import javax.xml.namespace.QName;
import javax.xml.stream.FactoryConfigurationError;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;

import org.apache.axiom.om.OMAttribute;
import org.apache.axiom.om.OMContainer;
import org.apache.axiom.om.OMDocument;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMException;
import org.apache.axiom.om.OMNamespace;
import org.apache.axiom.om.OMText;
import org.apache.axiom.om.impl.builder.StAXOMBuilder;
import org.apache.axiom.om.OMXMLBuilderFactory;
import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axiom.om.xpath.AXIOMXPath;
import org.deegree.commons.tom.ows.Version;
import org.deegree.commons.xml.stax.XMLStreamReaderDoc;
Expand Down Expand Up @@ -393,10 +392,10 @@ public void load(InputStream istream, String systemId) throws XMLProcessingExcep
// document contains a DOCTYPE definition

try {
StAXOMBuilder builder = new StAXOMBuilder(istream);
OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(istream);
rootElement = builder.getDocumentElement();
}
catch (XMLStreamException e) {
catch (Exception e) {
throw new XMLProcessingException(e.getMessage(), e);
}

Expand All @@ -415,10 +414,10 @@ public void load(InputStream istream, String systemId) throws XMLProcessingExcep
*/
public void load(XMLStreamReader xmlStream) throws XMLProcessingException {
if (xmlStream.getEventType() != XMLStreamConstants.START_DOCUMENT) {
setRootElement(new StAXOMBuilder(new XMLStreamReaderDoc(xmlStream)).getDocumentElement());
setRootElement(createStAXOMBuilder(new XMLStreamReaderDoc(xmlStream)).getDocumentElement());
}
else {
setRootElement(new StAXOMBuilder(xmlStream).getDocumentElement());
setRootElement(createStAXOMBuilder(xmlStream).getDocumentElement());
}
if (xmlStream.getLocation() != null && xmlStream.getLocation().getSystemId() != null) {
setSystemId(xmlStream.getLocation().getSystemId());
Expand Down Expand Up @@ -489,18 +488,11 @@ public void load(StringReader reader, String systemId) throws XMLProcessingExcep
setSystemId(systemId);

XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(reader);
StAXOMBuilder builder = new StAXOMBuilder(parser);
rootElement = builder.getDocumentElement();
rootElement = createStAXOMBuilder(parser).getDocumentElement();
}
catch (XMLStreamException e) {
throw new XMLProcessingException(e.getMessage(), e);
}
catch (OMException e) {
throw new XMLProcessingException(e.getMessage(), e);
}
catch (FactoryConfigurationError e) {
throw new XMLProcessingException(e.getMessage(), e);
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.Unmarshaller;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Schema;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- This file is part of deegree, for copyright/license information, please visit http://www.deegree.org/license. -->
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:d="http://www.deegree.org/metadata/description"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" targetNamespace="http://www.deegree.org/metadata/description"
elementFormDefault="qualified" jaxb:version="2.1">
xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb" targetNamespace="http://www.deegree.org/metadata/description"
elementFormDefault="qualified" jaxb:version="3.0">

<annotation>
<appinfo>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<!--
This file is part of deegree, for copyright/license information, please visit http://www.deegree.org/license.
-->
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:jdbc="http://www.deegree.org/proxy" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
targetNamespace="http://www.deegree.org/proxy" elementFormDefault="qualified" jaxb:version="2.1">
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:jdbc="http://www.deegree.org/proxy" xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb"
targetNamespace="http://www.deegree.org/proxy" elementFormDefault="qualified" jaxb:version="3.0">
<annotation>
<appinfo>
<jaxb:schemaBindings>
Expand Down
6 changes: 3 additions & 3 deletions deegree-core/deegree-core-coverage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<build>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand All @@ -33,6 +33,7 @@
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
<classifier>jakarta</classifier>
</dependency>
<dependency>
<groupId>com.sun.media</groupId>
Expand All @@ -56,4 +57,3 @@
</dependency>
</dependencies>
</project>

Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Occam Labs UG (haftungsbeschränkt)

import static org.deegree.commons.xml.jaxb.JAXBUtils.unmarshall;

import javax.xml.bind.JAXBException;
import jakarta.xml.bind.JAXBException;

import org.deegree.coverage.Coverage;
import org.deegree.coverage.persistence.pyramid.jaxb.Pyramid;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns:raster="http://www.deegree.org/datasource/coverage/pyramid" xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.deegree.org/datasource/coverage/pyramid" elementFormDefault="qualified"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.1">
xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb" jaxb:version="3.0">
<annotation>
<appinfo>
<jaxb:schemaBindings>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns:raster="http://www.deegree.org/datasource/coverage/raster" xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.deegree.org/datasource/coverage/raster" elementFormDefault="qualified"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.1">
xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb" jaxb:version="3.0">
<annotation>
<appinfo>
<jaxb:schemaBindings>
Expand Down
8 changes: 6 additions & 2 deletions deegree-core/deegree-core-cs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<build>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand All @@ -35,6 +35,10 @@
<artifactId>deegree-core-annotations</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>jakarta.activation</groupId>
<artifactId>jakarta.activation-api</artifactId>
</dependency>
<dependency>
<groupId>javax.media</groupId>
<artifactId>jai-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import java.net.URL;
import java.util.Map;

import javax.xml.bind.JAXBException;
import jakarta.xml.bind.JAXBException;

import org.deegree.commons.utils.net.DURL;
import org.deegree.commons.xml.XMLAdapter;
Expand Down
Loading

0 comments on commit 1fbb503

Please sign in to comment.