Skip to content

Commit 0967e5d

Browse files
author
Ivan Franchin
committed
project update
- update spring-boot to 2.4.3; - update mapstruct to 1.4.2.Final; - update springdoc openapi to 1.5.5; - update io.jsonwebtoken dependencies to 0.11.2; - update npm dependencies to latest ones; - set CORS AllowedOrigins as properties in application.yaml; - exclude lombok from spring-boot-maven-plugin.
1 parent 13cd48a commit 0967e5d

File tree

5 files changed

+710
-653
lines changed

5 files changed

+710
-653
lines changed

order-api/pom.xml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.springframework.boot</groupId>
77
<artifactId>spring-boot-starter-parent</artifactId>
8-
<version>2.4.1</version>
8+
<version>2.4.3</version>
99
<relativePath /> <!-- lookup parent from repository -->
1010
</parent>
1111

@@ -17,9 +17,9 @@
1717

1818
<properties>
1919
<java.version>11</java.version>
20-
<jjwt.version>0.11.1</jjwt.version>
21-
<org.mapstruct.version>1.4.1.Final</org.mapstruct.version>
22-
<springdoc.openapi.version>1.5.1</springdoc.openapi.version>
20+
<jjwt.version>0.11.2</jjwt.version>
21+
<org.mapstruct.version>1.4.2.Final</org.mapstruct.version>
22+
<springdoc.openapi.version>1.5.5</springdoc.openapi.version>
2323
</properties>
2424

2525
<dependencies>
@@ -100,19 +100,25 @@
100100
<plugin>
101101
<groupId>org.springframework.boot</groupId>
102102
<artifactId>spring-boot-maven-plugin</artifactId>
103+
<configuration>
104+
<excludes>
105+
<exclude>
106+
<groupId>org.projectlombok</groupId>
107+
<artifactId>lombok</artifactId>
108+
</exclude>
109+
</excludes>
110+
</configuration>
103111
</plugin>
104112
<plugin>
105113
<groupId>org.apache.maven.plugins</groupId>
106114
<artifactId>maven-compiler-plugin</artifactId>
107115
<configuration>
108116
<annotationProcessorPaths>
109-
<!-- Lombok -->
110117
<path>
111118
<groupId>org.projectlombok</groupId>
112119
<artifactId>lombok</artifactId>
113120
<version>${lombok.version}</version>
114121
</path>
115-
<!-- MapStruct -->
116122
<path>
117123
<groupId>org.mapstruct</groupId>
118124
<artifactId>mapstruct-processor</artifactId>

order-api/src/main/java/com/mycompany/orderapi/config/CorsConfig.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package com.mycompany.orderapi.config;
22

33
import java.util.Collections;
4+
import java.util.List;
45

6+
import org.springframework.beans.factory.annotation.Value;
57
import org.springframework.context.annotation.Bean;
68
import org.springframework.context.annotation.Configuration;
79
import org.springframework.web.cors.CorsConfiguration;
@@ -12,11 +14,11 @@
1214
public class CorsConfig {
1315

1416
@Bean
15-
CorsFilter corsFilter() {
17+
CorsFilter corsFilter(@Value("${app.cors.allowed-origins}") List<String> allowedOrigins) {
1618
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
1719
CorsConfiguration config = new CorsConfiguration();
1820
config.setAllowCredentials(true);
19-
config.setAllowedOrigins(Collections.singletonList("http://localhost:3000"));
21+
config.setAllowedOrigins(allowedOrigins);
2022
config.setAllowedMethods(Collections.singletonList("*"));
2123
config.setAllowedHeaders(Collections.singletonList("*"));
2224
source.registerCorsConfiguration("/**", config);

order-api/src/main/resources/application.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ app:
1616
secret: v9y$B&E)H@MbQeThWmZq4t7w!z%C*F-JaNdRfUjXn2r5u8x/A?D(G+KbPeShVkYp
1717
expiration:
1818
minutes: 10
19+
cors:
20+
allowed-origins: http://localhost:3000

0 commit comments

Comments
 (0)