-
Notifications
You must be signed in to change notification settings - Fork 3.1k
/
pom.xml
327 lines (313 loc) · 10.5 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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright The OpenZipkin Authors
SPDX-License-Identifier: Apache-2.0
-->
<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>
<parent>
<groupId>io.zipkin</groupId>
<artifactId>zipkin-parent</artifactId>
<version>3.4.4-SNAPSHOT</version>
</parent>
<artifactId>zipkin-lens</artifactId>
<name>Zipkin Lens</name>
<description>Repackages Zipkin Lens into a jar, so we can use it in zipkin-server</description>
<properties>
<main.basedir>${project.basedir}/..</main.basedir>
<npm.skipTests>false</npm.skipTests>
<!-- Update occasionally based on LTS, but don't overrun what's in Alpine:
https://nodejs.org/en/download/package-manager
https://pkgs.alpinelinux.org/packages?name=nodejs&branch=edge -->
<node.version>20.18.0</node.version>
<exec-maven-plugin.version>3.3.0</exec-maven-plugin.version>
<frontend-maven-plugin.version>1.15.0</frontend-maven-plugin.version>
<maven-clean-plugin.version>3.4.0</maven-clean-plugin.version>
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
</properties>
<dependencies>
<!-- no dependencies as this is just javascript -->
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>${exec-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>${frontend-maven-plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>${maven-clean-plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<executions>
<execution>
<id>remove existing NPM build</id>
<phase>compile</phase>
<goals>
<goal>clean</goal>
</goals>
<configuration>
<excludeDefaultDirectories>true</excludeDefaultDirectories>
<filesets>
<fileset>
<directory>build</directory>
</fileset>
</filesets>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<configuration>
<installDirectory>target</installDirectory>
<nodeVersion>v${node.version}</nodeVersion>
<environmentVariables>
<!--
create-react-app runs tests in watch mode unless this is defined. We define it here for running Maven locally.
-->
<CI>true</CI>
</environmentVariables>
</configuration>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>npm lint</id>
<goals>
<goal>npm</goal>
</goals>
<phase>compile</phase>
<configuration>
<arguments>run lint</arguments>
</configuration>
</execution>
<execution>
<id>npm run build</id>
<goals>
<goal>npm</goal>
</goals>
<phase>compile</phase>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>
<execution>
<id>npm run test</id>
<goals>
<goal>npm</goal>
</goals>
<phase>test</phase>
<configuration>
<skipTests>${npm.skipTests}</skipTests>
<arguments>run test</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
<executions>
<execution>
<id>copy NPM build to zipkin-lens directory</id>
<!-- This needs to happen after compile, or it could copy an empty directory! -->
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<!-- NPM build output will end up in the jar under the 'zipkin-lens' directory -->
<outputDirectory>${project.build.directory}/classes/zipkin-lens</outputDirectory>
<resources>
<resource>
<directory>build</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- remove the META-INF directory, as this is just static assets -->
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<!-- Allows us to use a true value in maven-exec-plugin when skipTests exist only in name -->
<profile>
<id>normalize skipTests</id>
<activation>
<property>
<name>skipTests</name>
</property>
</activation>
<properties>
<npm.skipTests>true</npm.skipTests>
</properties>
</profile>
<!-- frontend-maven-plugin requires downloading via a public URL, and suggests exec-maven-plugin
otherwise.
ARM64 is not supported with musl, yet https://github.com/nodejs/node/blob/master/BUILDING.md
See issue #3166
There are problems on alpine+arm64 with posix_spawn. https://github.com/openzipkin/docker-java/issues/34
So, always execute exporting MAVEN_OPTS=-Djdk.lang.Process.launchMechanism=vfork -->
<profile>
<id>exec-maven-plugin</id>
<activation>
<os>
<arch>aarch64</arch>
</os>
<file>
<exists>/etc/alpine-release</exists>
</file>
</activation>
<build>
<plugins>
<!-- It isn't currently possible to disable frontend-maven-plugin.
Instead, we set each execution to none -->
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>install node and npm</id>
<phase>none</phase>
</execution>
<execution>
<id>npm install</id>
<phase>none</phase>
</execution>
<execution>
<id>npm lint</id>
<phase>none</phase>
</execution>
<execution>
<id>npm run build</id>
<phase>none</phase>
</execution>
<execution>
<id>npm run test</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<!-- This duplicates exactly what we did in frontend-maven-plugin -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<environmentVariables>
<!--
create-react-app runs tests in watch mode unless this is defined. We define it here for running Maven locally.
-->
<CI>true</CI>
</environmentVariables>
</configuration>
<executions>
<execution>
<id>npm install</id>
<goals>
<goal>exec</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<executable>npm</executable>
<arguments>
<argument>install</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>npm run build</id>
<goals>
<goal>exec</goal>
</goals>
<phase>compile</phase>
<configuration>
<executable>npm</executable>
<arguments>
<argument>run</argument>
<argument>build</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>release</id>
<build>
<plugins>
<!-- Creates empty javadoc jar -->
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>empty-javadoc-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>javadoc</classifier>
<classesDirectory>${project.basedir}/javadoc</classesDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>