Skip to content

Commit

Permalink
Prepare Spring Boot 3.0 Ready build
Browse files Browse the repository at this point in the history
  • Loading branch information
f11h committed Jan 31, 2023
1 parent 5730eae commit 23789f5
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 21 deletions.
21 changes: 11 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-parent</artifactId>
<version>2022.0.1</version>
<relativePath/>
</parent>

<groupId>eu.europa.ec.dgc</groupId>
<artifactId>dgc-lib</artifactId>
<version>latest</version>
<version>2.0.0</version>
<packaging>jar</packaging>

<name>dgc-lib</name>
Expand All @@ -17,15 +24,13 @@
</organization>

<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<!-- charset -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- dependencies -->
<owasp.version>7.3.0</owasp.version>
<spring.boot.version>2.7.5</spring.boot.version>
<spring.cloud.version>3.1.4</spring.cloud.version>
<feign.version>11.10</feign.version>
<bcpkix.version>1.70</bcpkix.version>
<lombok.version>1.18.24</lombok.version>
Expand Down Expand Up @@ -74,7 +79,6 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring.boot.version}</version>
<optional>true</optional>
<exclusions>
<exclusion>
Expand All @@ -96,13 +100,11 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<version>${spring.boot.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
<version>${spring.cloud.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
Expand Down Expand Up @@ -162,7 +164,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<version>${spring.boot.version}</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
Expand Down Expand Up @@ -293,7 +294,7 @@
<path>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<version>${spring.boot.version}</version>
<version>${project.parent.parent.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/eu/europa/ec/dgc/DgcLibAutoConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@

package eu.europa.ec.dgc;

import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@AutoConfiguration
@ComponentScan("eu.europa.ec.dgc")
@EnableConfigurationProperties
public class DgcLibAutoConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import eu.europa.ec.dgc.signing.SignedStringMessageParser;
import eu.europa.ec.dgc.utils.CertificateUtils;
import feign.FeignException;
import jakarta.annotation.PostConstruct;
import java.io.IOException;
import java.io.Serializable;
import java.nio.charset.StandardCharsets;
Expand All @@ -48,7 +49,6 @@
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
Expand Down Expand Up @@ -217,7 +217,7 @@ public List<X509CertificateHolder> fetchCertificatesAndVerifyByTrustAnchor(Certi

if (downloadedCertificates.getStatusCode() != HttpStatus.OK || downloadedCertificates.getBody() == null) {
log.error("Failed to Download certificates from DGC Gateway, Type: {}, Status Code: {}",
type, downloadedCertificates.getStatusCodeValue());
type, downloadedCertificates.getStatusCode());
return Collections.emptyList();
}

Expand Down Expand Up @@ -249,7 +249,7 @@ public List<TrustedIssuer> fetchTrustedIssuersAndVerifyByTrustAnchor(

if (responseEntity.getStatusCode() != HttpStatus.OK || downloadedTrustedIssuers == null) {
throw new DgcGatewayConnectorUtils.DgcGatewayConnectorException(
responseEntity.getStatusCodeValue(), "Download of TrustedIssuers failed.");
responseEntity.getStatusCode().value(), "Download of TrustedIssuers failed.");
} else {
log.info("Got Response from DGCG, Downloaded TrustedIssuers: {}",
downloadedTrustedIssuers.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
import eu.europa.ec.dgc.gateway.connector.client.DgcGatewayConnectorRestClient;
import eu.europa.ec.dgc.gateway.connector.config.DgcGatewayConnectorConfigProperties;
import feign.FeignException;
import jakarta.annotation.PostConstruct;
import java.security.Security;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.annotation.PostConstruct;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import eu.europa.ec.dgc.gateway.connector.model.TrustListItem;
import eu.europa.ec.dgc.signing.SignedCertificateMessageParser;
import feign.FeignException;
import jakarta.annotation.PostConstruct;
import java.security.Security;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
Expand All @@ -37,7 +38,6 @@
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import eu.europa.ec.dgc.signing.SignedStringMessageBuilder;
import eu.europa.ec.dgc.utils.CertificateUtils;
import feign.FeignException;
import jakarta.annotation.PostConstruct;
import java.io.IOException;
import java.security.KeyStore;
import java.security.KeyStoreException;
Expand All @@ -39,7 +40,6 @@
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateEncodingException;
import java.security.cert.X509Certificate;
import javax.annotation.PostConstruct;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import eu.europa.ec.dgc.gateway.connector.config.DgcGatewayConnectorConfigProperties;
import eu.europa.ec.dgc.gateway.connector.model.QueryParameter;
import eu.europa.ec.dgc.gateway.connector.model.TrustedIssuer;
import jakarta.annotation.PostConstruct;
import java.io.Serializable;
import java.security.Security;
import java.time.LocalDateTime;
Expand All @@ -31,7 +32,6 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import javax.annotation.PostConstruct;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import eu.europa.ec.dgc.signing.SignedCertificateMessageBuilder;
import eu.europa.ec.dgc.utils.CertificateUtils;
import feign.FeignException;
import jakarta.annotation.PostConstruct;
import java.io.IOException;
import java.security.KeyStore;
import java.security.KeyStoreException;
Expand All @@ -36,7 +37,6 @@
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateEncodingException;
import java.security.cert.X509Certificate;
import javax.annotation.PostConstruct;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import eu.europa.ec.dgc.signing.SignedStringMessageBuilder;
import eu.europa.ec.dgc.utils.CertificateUtils;
import feign.FeignException;
import jakarta.annotation.PostConstruct;
import java.io.IOException;
import java.security.KeyStore;
import java.security.KeyStoreException;
Expand All @@ -36,7 +37,6 @@
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateEncodingException;
import java.security.cert.X509Certificate;
import javax.annotation.PostConstruct;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/META-INF/spring.factories

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
eu.europa.ec.dgc.DgcLibAutoConfiguration

0 comments on commit 23789f5

Please sign in to comment.