-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pom.xml
93 lines (85 loc) · 3.88 KB
/
pom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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>
<groupId>berlin.yuna</groupId>
<artifactId>nats-graalvm-example</artifactId>
<version>1.0.0</version>
<properties>
<!-- PROPERTIES -->
<java-version>21</java-version>
<project.encoding>UTF-8</project.encoding>
<project.build.sourceEncoding>${project.encoding}</project.build.sourceEncoding>
<project.reporting.outputEncoding>${project.encoding}</project.reporting.outputEncoding>
<!-- PRODUCTION -->
<nats-server.version>2.10.9</nats-server.version>
<jnats.version>2.17.4</jnats.version>
<!-- BUILD -->
<maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
<native-image-maven-plugin.version>21.2.0</native-image-maven-plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>berlin.yuna</groupId>
<artifactId>nats-server</artifactId>
<version>${nats-server.version}</version>
</dependency>
<dependency>
<groupId>io.nats</groupId>
<artifactId>jnats</artifactId>
<version>${jnats.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${java-version}</source>
<target>${java-version}</target>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<!-- NATIVE COMPILATION -->
<profile>
<id>native</id>
<build>
<plugins>
<plugin>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>native-image-maven-plugin</artifactId>
<version>${native-image-maven-plugin.version}</version>
<configuration>
<imageName>native-executable</imageName>
<mainClass>berlin.yuna.nativeexample.Main</mainClass>
<buildArgs>
<!-- Reduces the image size - Ensures the native image doesn't include the JVM as a fallback option -->
<buildArg>--no-fallback</buildArg>
<!-- Disables the use of the GraalVM compilation server -->
<buildArg>--no-server</buildArg>
<!-- Improve startup time - Initialize classes at build time rather than at runtime -->
<buildArg>--initialize-at-build-time</buildArg>
<!-- Nats Specific parameter -->
<buildArg>--initialize-at-run-time=io.nats.client.support.RandomUtils</buildArg>
<buildArg>--initialize-at-run-time=java.security.SecureRandom</buildArg>
</buildArgs>
</configuration>
<executions>
<execution>
<goals>
<goal>native-image</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>