Skip to content

Commit 13cd48a

Browse files
author
Ivan Franchin
committed
project update
- update to spring-boot 2.4.1; - update npm dependencies to latest versions; - update to springdoc openapi 1.5.1; - update to mapstruct 1.4.1; - update to mysql version 8.0.22; - remove junit-vintage-engine exclusion in pom.xml; - add .eslintcache to .gitignore; - fix allowedOrigins in corsFilter bean.
1 parent ac13f21 commit 13cd48a

File tree

7 files changed

+27924
-5003
lines changed

7 files changed

+27924
-5003
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,4 @@ npm-debug.log*
5757
yarn-debug.log*
5858
yarn-error.log*
5959

60+
.eslintcache

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The goal of this project is to implement an application called `order-app` to ma
44

55
## Applications
66

7-
- **order-api**
7+
- ### order-api
88

99
`Spring Boot` Web Java backend application that exposes a Rest API to create, retrieve and delete orders. If a user has `ADMIN` role he/she can also retrieve information of other users or delete them.
1010

@@ -28,7 +28,7 @@ The goal of this project is to implement an application called `order-app` to ma
2828
| `POST /api/orders -d {"description"}` | Yes | `ADMIN`, `USER` |
2929
| `DELETE /api/orders/{id}` | Yes | `ADMIN` |
3030

31-
- **order-ui**
31+
- ### order-ui
3232

3333
`ReactJS` frontend application where a user with role `USER` can create an order and retrieve a specific order. On the other hand, a user with role `ADMIN` as access to all secured endpoints.
3434

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ services:
33

44
mysql:
55
container_name: mysql
6-
image: mysql:8.0.21
6+
image: mysql:8.0.22
77
ports:
88
- "3306:3306"
99
environment:

order-api/pom.xml

Lines changed: 24 additions & 16 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.3.4.RELEASE</version>
8+
<version>2.4.1</version>
99
<relativePath /> <!-- lookup parent from repository -->
1010
</parent>
1111

@@ -18,8 +18,8 @@
1818
<properties>
1919
<java.version>11</java.version>
2020
<jjwt.version>0.11.1</jjwt.version>
21-
<mapstruct.version>1.3.1.Final</mapstruct.version>
22-
<springdoc.openapi.version>1.4.7</springdoc.openapi.version>
21+
<org.mapstruct.version>1.4.1.Final</org.mapstruct.version>
22+
<springdoc.openapi.version>1.5.1</springdoc.openapi.version>
2323
</properties>
2424

2525
<dependencies>
@@ -63,13 +63,7 @@
6363
<dependency>
6464
<groupId>org.mapstruct</groupId>
6565
<artifactId>mapstruct</artifactId>
66-
<version>${mapstruct.version}</version>
67-
</dependency>
68-
<dependency>
69-
<groupId>org.mapstruct</groupId>
70-
<artifactId>mapstruct-processor</artifactId>
71-
<version>${mapstruct.version}</version>
72-
<scope>provided</scope>
66+
<version>${org.mapstruct.version}</version>
7367
</dependency>
7468

7569
<!-- SpringDoc OpenApi -->
@@ -98,12 +92,6 @@
9892
<groupId>org.springframework.boot</groupId>
9993
<artifactId>spring-boot-starter-test</artifactId>
10094
<scope>test</scope>
101-
<exclusions>
102-
<exclusion>
103-
<groupId>org.junit.vintage</groupId>
104-
<artifactId>junit-vintage-engine</artifactId>
105-
</exclusion>
106-
</exclusions>
10795
</dependency>
10896
</dependencies>
10997

@@ -113,6 +101,26 @@
113101
<groupId>org.springframework.boot</groupId>
114102
<artifactId>spring-boot-maven-plugin</artifactId>
115103
</plugin>
104+
<plugin>
105+
<groupId>org.apache.maven.plugins</groupId>
106+
<artifactId>maven-compiler-plugin</artifactId>
107+
<configuration>
108+
<annotationProcessorPaths>
109+
<!-- Lombok -->
110+
<path>
111+
<groupId>org.projectlombok</groupId>
112+
<artifactId>lombok</artifactId>
113+
<version>${lombok.version}</version>
114+
</path>
115+
<!-- MapStruct -->
116+
<path>
117+
<groupId>org.mapstruct</groupId>
118+
<artifactId>mapstruct-processor</artifactId>
119+
<version>${org.mapstruct.version}</version>
120+
</path>
121+
</annotationProcessorPaths>
122+
</configuration>
123+
</plugin>
116124
</plugins>
117125
</build>
118126

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ CorsFilter corsFilter() {
1616
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
1717
CorsConfiguration config = new CorsConfiguration();
1818
config.setAllowCredentials(true);
19-
config.setAllowedOrigins(Collections.singletonList("*"));
19+
config.setAllowedOrigins(Collections.singletonList("http://localhost:3000"));
2020
config.setAllowedMethods(Collections.singletonList("*"));
2121
config.setAllowedHeaders(Collections.singletonList("*"));
2222
source.registerCorsConfiguration("/**", config);

0 commit comments

Comments
 (0)