forked from tomas-langer/helidon-graal-vm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pom.xml
245 lines (234 loc) · 10.4 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
<?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>io.helidon.examples</groupId>
<artifactId>helidon-graalvm-native-image</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>Helidon Graal native image example</name>
<properties>
<version.helidon>1.0.1</version.helidon>
<version.graalvm>1.0.0-rc13</version.graalvm>
<version.plugin.dockerfile>1.4.10</version.plugin.dockerfile>
<copied.libs.dir>${project.build.directory}/dependency</copied.libs.dir>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>${maven.compiler.source}</maven.compiler.target>
<!--
Native image configuration
-->
<!-- TODO path to the native-image -->
<native.image>${user.home}/graal/graalvm-ce-1.0.0-rc13/Contents/Home/bin/native-image</native.image>
<!--
Application specific configuration
-->
<!-- Resources to include in the image -->
<native.resources>application.yaml|logging.properties</native.resources>
<!-- Main class (entry point) -->
<main.class>io.helidon.examples.graalvm.GraalVMNativeImageMain</main.class>
<!-- Port of the application, to expose it from docker, also used
to filter the configuration file -->
<main.port>8099</main.port>
<!--
Name of the native executable
Only used when building local native image
-->
<native.name>helidon-example-native-image</native.name>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.helidon</groupId>
<artifactId>helidon-bom</artifactId>
<version>${version.helidon}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.graalvm.sdk</groupId>
<artifactId>graal-sdk</artifactId>
<version>${version.graalvm}</version>
</dependency>
<dependency>
<groupId>com.oracle.substratevm</groupId>
<artifactId>svm</artifactId>
<version>${version.graalvm}</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<!-- Webserver - supports string entities -->
<groupId>io.helidon.webserver</groupId>
<artifactId>helidon-webserver</artifactId>
</dependency>
<dependency>
<!-- Support for JSON-P entities -->
<groupId>io.helidon.media.jsonp</groupId>
<artifactId>helidon-media-jsonp-server</artifactId>
</dependency>
<dependency>
<!-- Support for JSON-B entities -->
<groupId>io.helidon.media.jsonb</groupId>
<artifactId>helidon-media-jsonb-server</artifactId>
</dependency>
<dependency>
<!--
Support for YAML configuration files
Without this library, only .properties are supported
-->
<groupId>io.helidon.config</groupId>
<artifactId>helidon-config-yaml</artifactId>
</dependency>
<dependency>
<!-- Support for metrics (endpoint /metrics) -->
<groupId>io.helidon.metrics</groupId>
<artifactId>helidon-metrics</artifactId>
</dependency>
<dependency>
<!-- Support for health checks -->
<groupId>io.helidon.health</groupId>
<artifactId>helidon-health</artifactId>
</dependency>
<dependency>
<!-- Support for tracing - integration with Zipkin -->
<groupId>io.helidon.tracing</groupId>
<artifactId>helidon-tracing-zipkin</artifactId>
</dependency>
<dependency>
<!-- Pre-built health checks (only memory works in native image) -->
<groupId>io.helidon.health</groupId>
<artifactId>helidon-health-checks</artifactId>
</dependency>
<dependency>
<!-- Security integration with web server -->
<groupId>io.helidon.security.integration</groupId>
<artifactId>helidon-security-integration-webserver</artifactId>
</dependency>
<dependency>
<!-- ABAC security provider (used for role based access) -->
<groupId>io.helidon.security.providers</groupId>
<artifactId>helidon-security-providers-abac</artifactId>
</dependency>
<dependency>
<!-- Basic authentication security provider -->
<groupId>io.helidon.security.providers</groupId>
<artifactId>helidon-security-providers-http-auth</artifactId>
</dependency>
<dependency>
<!-- Helidon extension for native image - required -->
<groupId>io.helidon.integrations.graal</groupId>
<artifactId>helidon-graal-native-image-extension</artifactId>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>build-native-image</id>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${native.image}</executable>
<arguments>
<argument>-H:Name=${basedir}/target/${native.name}</argument>
<argument>-H:IncludeResources=${native.resources}</argument>
<!-- <argument>--debug-attach</argument>-->
<argument>-H:+ReportExceptionStackTraces</argument>
<!-- this is a workaround for issue with server, when a new library with a Java service
is added, the server cannot find its implementation class-->
<argument>--no-server</argument>
<argument>-classpath</argument>
<classpath/>
<argument>${main.class}</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>run-native-image</id>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${basedir}/target/${native.name}</executable>
</configuration>
</execution>
</executions>
<configuration>
<executable>java</executable>
<arguments>
<argument>-classpath</argument>
<classpath/>
<argument>${main.class}</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>native-image-docker</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${copied.libs.dir}</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<overWriteIfNewer>true</overWriteIfNewer>
<includeScope>runtime</includeScope>
<excludeScope>test</excludeScope>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>${version.plugin.dockerfile}</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>build</goal>
<!-- binds push goal to maven deploy -->
<!-- <goal>push</goal>-->
</goals>
</execution>
</executions>
<configuration>
<repository>helidon/example-graal</repository>
<tag>${project.version}</tag>
<buildArgs>
<NATIVE_ENTRY_POINT>${main.class}</NATIVE_ENTRY_POINT>
<NATIVE_RESOURCES>${native.resources}</NATIVE_RESOURCES>
<PORT>${main.port}</PORT>
</buildArgs>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>