File tree 6 files changed +29
-11
lines changed
architectural-pattern/scatter-gather
src/main/java/com/vinsguru/util
6 files changed +29
-11
lines changed Original file line number Diff line number Diff line change 1
- FROM openjdk:11.0.6-jre-slim
1
+ FROM bellsoft/liberica- openjdk-alpine:21
2
2
3
3
WORKDIR /usr/app
4
4
Original file line number Diff line number Diff line change 15
15
<dependency >
16
16
<groupId >com.vinsguru</groupId >
17
17
<artifactId >common-dto</artifactId >
18
- <version >0.0.1-SNAPSHOT</version >
19
18
</dependency >
20
19
<dependency >
21
20
<groupId >io.nats</groupId >
22
21
<artifactId >jnats</artifactId >
23
- <version >2.15.3</version >
24
22
</dependency >
25
23
</dependencies >
26
24
30
28
<groupId >org.springframework.boot</groupId >
31
29
<artifactId >spring-boot-maven-plugin</artifactId >
32
30
<configuration >
33
- <fork >true</fork >
34
31
<skip >false</skip >
35
32
</configuration >
36
33
<executions >
Original file line number Diff line number Diff line change 17
17
<dependency >
18
18
<groupId >com.fasterxml.jackson.core</groupId >
19
19
<artifactId >jackson-databind</artifactId >
20
- <version >2.12.0</version >
21
20
</dependency >
22
21
</dependencies >
23
22
Original file line number Diff line number Diff line change 6
6
7
7
public class ObjectUtil {
8
8
9
+ private static final ObjectMapper mapper = new ObjectMapper ();
10
+
9
11
public static <T > Optional <T > toObject (byte [] src , Class <T > type ){
10
12
try {
11
- ObjectMapper mapper = new ObjectMapper ();
12
13
return Optional .of (mapper .readValue (src , type ));
13
14
}catch (Exception e ){
14
- return Optional .empty ();
15
+ return Optional .empty ();
15
16
}
16
17
}
17
18
18
19
public static byte [] toBytes (Object o ){
19
20
try {
20
- ObjectMapper mapper = new ObjectMapper ();
21
21
return mapper .writeValueAsBytes (o );
22
22
}catch (Exception e ){
23
23
return new byte [0 ];
Original file line number Diff line number Diff line change 1
- FROM openjdk:11.0.6-jre-slim
1
+ FROM bellsoft/liberica- openjdk-alpine:21
2
2
3
3
WORKDIR /usr/app
4
4
Original file line number Diff line number Diff line change 11
11
<parent >
12
12
<groupId >org.springframework.boot</groupId >
13
13
<artifactId >spring-boot-starter-parent</artifactId >
14
- <version >2.7.1 </version >
14
+ <version >3.2.0 </version >
15
15
<relativePath /> <!-- lookup parent from repository -->
16
16
</parent >
17
17
<groupId >com.vinsguru</groupId >
21
21
<description >Demo project for Spring Boot</description >
22
22
23
23
<properties >
24
- <java .version>11</java .version>
24
+ <java .version>21</java .version>
25
+ <nats .version>2.17.1</nats .version>
26
+ <jackson .version>2.16.0</jackson .version>
25
27
</properties >
26
28
29
+ <dependencyManagement >
30
+ <dependencies >
31
+ <dependency >
32
+ <groupId >com.vinsguru</groupId >
33
+ <artifactId >common-dto</artifactId >
34
+ <version >${project.version} </version >
35
+ </dependency >
36
+ <dependency >
37
+ <groupId >io.nats</groupId >
38
+ <artifactId >jnats</artifactId >
39
+ <version >${nats.version} </version >
40
+ </dependency >
41
+ <dependency >
42
+ <groupId >com.fasterxml.jackson.core</groupId >
43
+ <artifactId >jackson-databind</artifactId >
44
+ <version >${jackson.version} </version >
45
+ </dependency >
46
+ </dependencies >
47
+ </dependencyManagement >
48
+
27
49
<dependencies >
28
50
<dependency >
29
51
<groupId >org.projectlombok</groupId >
You can’t perform that action at this time.
0 commit comments