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

Upgrade to jakarta.validation-api and hibernate v.8 as default validator (java 11) #73

Merged
merged 2 commits into from
Nov 30, 2023
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
build:
strategy:
matrix:
java: [ '8', '11', '17' ]
java: [ '11', '17', '21' ]
name: Build on Java ${{ matrix.java }}
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .java-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.8
11.0
20 changes: 11 additions & 9 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,23 @@ specific language governing permissions and limitations
under the License.

This project includes:
Bean Validation API under Apache License 2.0
ClassMate under The Apache Software License, Version 2.0
Angus Activation Registries under EDL 1.0
ClassMate under Apache License, Version 2.0
Digipost Data Types under The Apache Software License, Version 2.0
Digipost JAXB Resolver - com.sun.xml.bind under The Apache Software License, Version 2.0
Expression Language 3.0 API under CDDL + GPLv2 with classpath exception
Eclipse Expressly under Eclipse Public License v. 2.0 or GNU General Public License, version 2 with the GNU Classpath Exception
Hibernate Validator Engine under Apache License 2.0
istack common utility code runtime under Eclipse Distribution License - v 1.0
Jackson datatype: JSR310 under The Apache Software License, Version 2.0
Jackson-annotations under The Apache Software License, Version 2.0
Jackson-core under The Apache Software License, Version 2.0
jackson-databind under The Apache Software License, Version 2.0
Jakarta Expression Language 3.0 Implementation under EPL 2.0 or GPL2 w/ CPE
JavaBeans Activation Framework API jar under CDDL/GPLv2+CE
jaxb-api under CDDL 1.1 or GPL2 w/ CPE
Jakarta Activation API under EDL 1.0
Jakarta Bean Validation API under Apache License 2.0
Jakarta Expression Language API under Eclipse Public License v. 2.0 or GNU General Public License, version 2 with the GNU Classpath Exception
Jakarta XML Binding API under Eclipse Distribution License - v 1.0
JAXB Core under Eclipse Distribution License - v 1.0
JAXB Runtime under Eclipse Distribution License - v 1.0
JBoss Logging 3 under Apache License, version 2.0
Old JAXB Core under CDDL+GPL License
Old JAXB Runtime under Eclipse Distribution License - v 1.0
Project Lombok under The MIT License
TXW2 Runtime under Eclipse Distribution License - v 1.0

993 changes: 464 additions & 529 deletions datatypes.xsd

Large diffs are not rendered by default.

90 changes: 36 additions & 54 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,17 @@
<description>Data types for Digipost messages</description>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<lombok.version>1.18.30</lombok.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>no.digipost</groupId>
<artifactId>jaxb-resolver-com.sun.xml.bind-bom</artifactId>
<version>1.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>2.14.2</version>
<version>2.16.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -48,7 +42,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.20</version>
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -68,50 +62,40 @@
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.1.5.Final</version>
<version>8.0.0.Final</version>
<scope>runtime</scope>
<optional>true</optional>
<exclusions>
<exclusion>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.sun.el</groupId>
<artifactId>el-ri</artifactId>
<version>3.0.4</version>
<groupId>org.glassfish.expressly</groupId>
<artifactId>expressly</artifactId>
<version>5.0.0</version>
<scope>runtime</scope>
<optional>true</optional>
<exclusions>
<exclusion>
<groupId>jakarta.el</groupId>
<artifactId>jakarta.el-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>javax.el-api</artifactId>
<version>3.0.0</version>
<groupId>jakarta.el</groupId>
<artifactId>jakarta.el-api</artifactId>
<version>5.0.1</version>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>no.digipost</groupId>
<artifactId>jaxb-resolver-com.sun.xml.bind</artifactId>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>4.0.4</version>
<scope>runtime</scope>
</dependency>
<dependency>
Expand All @@ -133,7 +117,7 @@
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<version>2.2-rc1</version>
<version>2.2</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -259,16 +243,23 @@
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>
</dependencies>
<configuration>
<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
<sourceDirectory>${project.build.sourceDirectory}/no/digipost/api/datatypes/types/</sourceDirectory>
<outputDirectory>${project.build.directory}/schemagen-work/lombok</outputDirectory>
<addOutputDirectory>false</addOutputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>2.3.1</version>
<version>3.1.0</version>
<executions>
<execution>
<id>schemagen</id>
Expand All @@ -281,28 +272,19 @@
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.2</version>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.2</version>
<version>4.0.4</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<configuration>
<sources>
<source>${project.build.directory}/schemagen-work/lombok</source>
</sources>
<schemaSourceExcludeFilters>
<filter implementation="org.codehaus.mojo.jaxb2.shared.filters.pattern.PatternFileFilter">
<patterns>
<pattern>marshalling</pattern>
<pattern>validation</pattern>
<pattern>documentation</pattern>
</patterns>
</filter>
</schemaSourceExcludeFilters>
<transformSchemas>
<transformSchema>
<uri>http://api.digipost.no/schema/datatypes</uri>
Expand Down Expand Up @@ -352,8 +334,8 @@
</plugin>
<plugin>
<groupId>org.jasig.maven</groupId>
<artifactId>maven-notice-plugin</artifactId>
<version>1.1.0</version>
<artifactId>notice-maven-plugin</artifactId>
<version>2.0.0</version>
<configuration>
<excludeScopes>
<excludeScope>test</excludeScope>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import no.digipost.api.datatypes.types.proof.Proof;
import no.digipost.api.datatypes.types.receipt.Receipt;
import no.digipost.api.datatypes.types.share.ShareDocumentsRequest;
import no.digipost.api.datatypes.types.share.ShareDocumentsRequestDocumentsShared;
import no.digipost.api.datatypes.types.share.ShareDocumentsRequestSharingStopped;

import java.util.Collections;
import java.util.Map;
Expand All @@ -28,9 +30,6 @@
import static java.util.stream.Collectors.toMap;
import static java.util.stream.Collectors.toSet;

import no.digipost.api.datatypes.types.share.ShareDocumentsRequestDocumentsShared;
import no.digipost.api.datatypes.types.share.ShareDocumentsRequestSharingStopped;

/**
* HOWTO: Add new data type
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package no.digipost.api.datatypes.documentation;

import jakarta.xml.bind.JAXBException;
import no.digipost.api.datatypes.DataType;
import no.digipost.api.datatypes.DataTypeIdentifier;
import no.digipost.api.datatypes.marshalling.DataTypesJAXBContext;

import javax.xml.bind.JAXBException;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package no.digipost.api.datatypes.documentation;

import jakarta.validation.constraints.NotNull;
import jakarta.xml.bind.annotation.XmlElement;
import no.digipost.api.datatypes.ComplementedBy;

import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlElement;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Field;
import java.util.Collections;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.SerializationFeature;
import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.Marshaller;
import no.digipost.api.datatypes.marshalling.DataTypesJsonMapper;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import java.io.StringWriter;
import java.util.HashSet;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package no.digipost.api.datatypes.marshalling;

import jakarta.xml.bind.Marshaller;
import jakarta.xml.bind.Unmarshaller;
import jakarta.xml.bind.annotation.adapters.XmlAdapter;
import no.digipost.api.datatypes.DataType;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.adapters.XmlAdapter;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.dom.DOMSource;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package no.digipost.api.datatypes.marshalling;

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

public class DataTypesJAXBContext {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package no.digipost.api.datatypes.marshalling;

import javax.xml.bind.annotation.adapters.XmlAdapter;
import jakarta.xml.bind.annotation.adapters.XmlAdapter;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package no.digipost.api.datatypes.marshalling;

import javax.xml.bind.annotation.adapters.XmlAdapter;
import jakarta.xml.bind.annotation.adapters.XmlAdapter;

import java.math.BigDecimal;

import static java.math.BigDecimal.ROUND_HALF_UP;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package no.digipost.api.datatypes.marshalling;

import javax.xml.bind.DatatypeConverter;
import javax.xml.bind.annotation.adapters.XmlAdapter;
import jakarta.xml.bind.DatatypeConverter;
import jakarta.xml.bind.annotation.adapters.XmlAdapter;

import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/no/digipost/api/datatypes/types/Address.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package no.digipost.api.datatypes.types;

import jakarta.validation.constraints.Size;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlType;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.Value;
import lombok.With;
import no.digipost.api.datatypes.documentation.Description;

import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

@XmlType
@Value
@AllArgsConstructor
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/no/digipost/api/datatypes/types/Appointment.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
package no.digipost.api.datatypes.types;

import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlRootElement;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
Expand All @@ -8,11 +13,6 @@
import no.digipost.api.datatypes.DataType;
import no.digipost.api.datatypes.documentation.Description;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.List;
Expand Down
Loading