forked from ekumahost/quantizr
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpom.xml
More file actions
725 lines (627 loc) · 23 KB
/
Copy pathpom.xml
File metadata and controls
725 lines (627 loc) · 23 KB
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
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
<?xml version="1.0" encoding="UTF-8"?>
<!-- There are 5 profiles: DEV,PROD,DEV-VSCODE,Webpack -->
<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>quanta</groupId>
<artifactId>quanta</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Quanta</name>
<description>Quanta - Content Platform for the Web</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<!--
Tip: When upgrading this verison it's a good ideal to blow away
the '.m2' hidden folder on your machine (maven cache) and also
enable this line in build.sh: "mvn dependency:sources", so you get
all new source AND remove all the old stuff
-->
<version>2.6.1</version>
<relativePath />
</parent>
<!-- ========== DEV PROFILE BEGIN ========== -->
<profiles>
<profile>
<id>dev</id>
<activation>
<!-- Prior to 4/5/2019 we had this profile as the default and the 'dev-vscode' profile didn't exist (below), for
more info on why there is dev and dev-vscode profiles see the long comment below that is
above the dev-vscode profile.
-->
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<!-- The filename below can contain only 'dev' or 'prod'. If you're troubleshooting React/Redux performance for example,
be sure to set to 'prod' so you aren't chasing performance problems what may not even exist in prod builds. -->
<webpack.args>--config webpack.dev.js</webpack.args>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<start-class>quanta.AppServer</start-class>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>quanta</groupId>
<artifactId>common</artifactId>
<version>1.0</version>
<type>pom</type>
</dependency>
</dependencies>
<build>
<filters>
<filter>src/main/resources/application.properties</filter>
</filters>
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>public/node_modules/**</exclude>
<exclude>public/node/**</exclude>
</excludes>
<!-- I have resource filtering disabled for now because i don't need it, but if you turn it back on don't forget
to add 'resources:resources' to the maven command for inside<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>9</source>
<target>9</target>
</configuration>
</plugin> VSCode AND also your prod builder shell script!!!
<filtering>true</filtering>
-->
</resource>
</resources>
<plugins>
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.1.0.Final</version>
<packaging>jar</packaging>
<file>${project.basedir}/jar/validation-api-1.1.0.Final.jar</file>
<generatePom>true</generatePom>
</configuration>
<executions>
<execution>
<id>install-jar-lib</id>
<goals>
<goal>install-file</goal>
</goals>
<phase>validate</phase>
</execution>
</executions>
</plugin>
-->
<!-- uncomment this to start generating javadocs. -->
<!-- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.1</version>
<configuration>
<reportOutputDirectory>./JavaDocs</reportOutputDirectory>
<destDir>JavaDocs</destDir>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin> -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<layout>ZIP</layout>
</configuration>
</plugin>
<!--
WARNING: It appears that only ONE exec-maven-plugin runs. Having two of these plugins won't work, because it ends up
only running one of them. Don't know why. So just put ALL scripting stuff in this one file
-->
<!--
With this plugin commented out you must also remove 'exec:exec' from the maven build command line (goals)
and of course put 'exec:exec' back in if you are doing the exec-maven-plugin.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<executable>./run-webpack.sh</executable>
<workingDirectory>./</workingDirectory>
</configuration>
</plugin>
-->
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.12.0</version>
<configuration>
<workingDirectory>src/main/resources/public</workingDirectory>
</configuration>
<executions>
<!-- Removed only to speed up builds -->
<!-- <execution>
<id>install-node-and-npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v16.13.0</nodeVersion>
</configuration>
<phase>generate-resources</phase>
</execution>
<execution>
<id>npm-install</id>
<goals>
<goal>npm</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>install</arguments>
</configuration>
</execution> -->
<execution>
<id>webpack-build</id>
<goals>
<goal>webpack</goal>
</goals>
<!-- optional: the default phase is "generate-resources" -->
<phase>generate-resources</phase>
<configuration>
<!-- optional: if not specified, it will run webpack's default
build (and you can remove this whole <configuration> section.) -->
<arguments>${webpack.args}</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!--
This profile is for the purpose of updating /target/classes only so we can do a rapid server reload/iteration
========== JAVA-COMPILE PROFILE BEGIN ========== -->
<profile>
<id>java-compile</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<start-class>quanta.AppServer</start-class>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>quanta</groupId>
<artifactId>common</artifactId>
<version>1.0</version>
<type>pom</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!-- <configuration>
<layout>ZIP</layout>
</configuration> -->
</plugin>
</plugins>
</build>
</profile>
<!-- ========== DEV-VSCODE PROFILE BEGIN ========== -->
<!-- This profile 'dev-vscode' is the one we activate by default so that when opening in VSCode we don't run into the
bug that exists where 'node' process will HANG forever with maxed out CPU usage. This profile is identical to the 'dev'
profile except for omitting the webpack part which causes this bug/hang. All profiles work just fine with or without
webpack when run on the command line, but it seems VSCode is not able to run any webpack without this bug happening, so the
solution is just that we never run any webpack from inside VSCode
Interestingly, this bug only happens then VSCode is automatically running the the build behind the scenes just because you
opened the project and it wants to run a build. Running from a tasks.json entry that runs './build.sh', from the Terminal
menu inside VSCode works just fine.
UPDATE: There ended up being an additional need for this profile to the above, which is the fact that it can compile the Java
and run the typescript-generator-maven-plugin to generate the generated TypeScript Interfaces, without WebPack trying to run first
which can potentially have outdated (old) generated file, and fail.
-->
<profile>
<id>dev-vscode</id>
<activation>
<!-- I think i added this 'default' designation so that IDEs can build always even when no specific build config is being run
Update: I set this activeByDefaut to 'false' on 4/6/2019, because I noticed the webpack process was hanging up in 'node' somehow,
and the 'node' process in linux was sitting ther burning up 155% CPU forever, in a loop. This stops VSCode from causing this to happen.
Somehow there is a bug in that scenario. VSCode detecting this and trying to run a build once you just merely open your IDE.
-->
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<start-class>quanta.AppServer</start-class>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>quanta</groupId>
<artifactId>common</artifactId>
<version>1.0</version>
<type>pom</type>
</dependency>
</dependencies>
<build>
<filters>
<filter>src/main/resources/application.properties</filter>
</filters>
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>public/node_modules/**</exclude>
<exclude>public/node/**</exclude>
</excludes>
<!-- I have resource filtering disabled for now because i don't need it, but if you turn it back on don't forget
to add 'resources:resources' to the maven command for inside<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>9</source>
<target>9</target>
</configuration>
</plugin> VSCode AND also your prod builder shell script!!!
<filtering>true</filtering>
-->
</resource>
</resources>
<plugins>
<plugin>
<groupId>cz.habarta.typescript-generator</groupId>
<artifactId>typescript-generator-maven-plugin</artifactId>
<version>2.22.595</version>
<executions>
<execution>
<id>generate</id>
<goals>
<goal>generate</goal>
</goals>
<phase>process-classes</phase>
</execution>
</executions>
<configuration>
<optionalAnnotations>
<annotation>javax.annotation.Nullable</annotation>
</optionalAnnotations>
<jsonLibrary>jackson2</jsonLibrary>
<!-- Supposedly this will allow @JsonProperty(required = false) in the java to put a '?' after the param
but unfortunately it doesn't default to 'true' as one would expect, so for now I'll leave it out
to get maximal typesafety
<optionalProperties>useLibraryDefinition</optionalProperties>
-->
<classPatterns>
<pattern>quanta.model.client.**</pattern>
<pattern>quanta.request.**</pattern>
<pattern>quanta.response.**</pattern>
</classPatterns>
<outputKind>module</outputKind>
<outputFile>src/main/resources/public/ts/JavaIntf.d.ts</outputFile>
<mapEnum>asEnum</mapEnum>
<jackson2Configuration>
<enumsUsingToString>true</enumsUsingToString>
</jackson2Configuration>
<noFileComment>true</noFileComment>
</configuration>
</plugin>
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.1.0.Final</version>
<packaging>jar</packaging>
<file>${project.basedir}/jar/validation-api-1.1.0.Final.jar</file>
<generatePom>true</generatePom>
</configuration>
<executions>
<execution>
<id>install-jar-lib</id>
<goals>
<goal>install-file</goal>
</goals>
<phase>validate</phase>
</execution>
</executions>
</plugin>
-->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!--
WARNING: It appears that only ONE exec-maven-plugin runs. Having two of these plugins won't work, because it ends up
only running one of them. Don't know why. So just put ALL scripting stuff in this one file
-->
<!--
With this plugin commented out you must also remove 'exec:exec' from the maven build command line (goals)
and of course put 'exec:exec' back in if you are doing the exec-maven-plugin.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<executable>./run-webpack.sh</executable>
<workingDirectory>./</workingDirectory>
</configuration>
</plugin>
-->
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<!-- Use the latest released version:
https://repo1.maven.org/maven2/com/github/eirslett/frontend-maven-plugin/ -->
<version>1.12.0</version>
<configuration>
<workingDirectory>src/main/resources/public</workingDirectory>
</configuration>
<executions>
<execution>
<!-- optional: you don't really need execution ids, but it looks nice in your build log. -->
<id>install-node-and-npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v16.13.0</nodeVersion>
<!-- optional: with node version greater than 4.0.0 will use npm provided by node distribution
<npmVersion>5.8.0</npmVersion>
-->
<!-- optional: where to download node and npm from. Defaults to https://nodejs.org/dist/
<downloadRoot>http://myproxy.example.org/nodejs/</downloadRoot>
-->
</configuration>
<!-- optional: default phase is "generate-resources" -->
<phase>generate-resources</phase>
</execution>
<execution>
<id>npm-install</id>
<goals>
<goal>npm</goal>
</goals>
<!-- optional: default phase is "generate-resources" -->
<phase>generate-resources</phase>
<configuration>
<!-- optional: The default argument is actually
"install", so unless you need to run some other npm command,
you can remove this whole <configuration> section.
-->
<arguments>install</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- ========== PROD PROFILE BEGIN ========== -->
<profile>
<id>prod</id>
<properties>
<webpack.args>--mode production --config webpack.prod.js</webpack.args>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<start-class>quanta.AppServer</start-class>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>quanta</groupId>
<artifactId>common</artifactId>
<version>1.0</version>
<type>pom</type>
</dependency>
</dependencies>
<build>
<filters>
<filter>src/main/resources/application.properties</filter>
</filters>
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>public/node_modules/**</exclude>
<exclude>public/node/**</exclude>
</excludes>
<!-- I have resource filtering disabled for now because i don't need it, but if you turn it back on don't forget
to add 'resources:resources' to the maven command for inside VSCode AND also your prod builder shell script!!!
<filtering>true</filtering>
-->
</resource>
</resources>
<plugins>
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.1.0.Final</version>
<packaging>jar</packaging>
<file>${project.basedir}/jar/validation-api-1.1.0.Final.jar</file>
<generatePom>true</generatePom>
</configuration>
<executions>
<execution>
<id>install-jar-lib</id>
<goals>
<goal>install-file</goal>
</goals>
<phase>validate</phase>
</execution>
</executions>
</plugin>
-->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!--
WARNING: It appears that only ONE exec-maven-plugin runs. Having two of these plugins won't work, because it ends up
only running one of them. Don't know why. So just put ALL scripting stuff in this one file
-->
<!--
With this plugin commented out you must also remove 'exec:exec' from the maven build command line (goals)
and of course put 'exec:exec' back in if you are doing the exec-maven-plugin.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<executable>./run-webpack.sh</executable>
<workingDirectory>./</workingDirectory>
</configuration>
</plugin>
-->
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<!-- Use the latest released version:
https://repo1.maven.org/maven2/com/github/eirslett/frontend-maven-plugin/ -->
<version>1.12.0</version>
<configuration>
<workingDirectory>src/main/resources/public</workingDirectory>
</configuration>
<executions>
<execution>
<!-- optional: you don't really need execution ids, but it looks nice in your build log. -->
<id>install-node-and-npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v16.13.0</nodeVersion>
<!-- optional: with node version greater than 4.0.0 will use npm provided by node distribution
<npmVersion>5.8.0</npmVersion>
-->
<!-- optional: where to download node and npm from. Defaults to https://nodejs.org/dist/
<downloadRoot>http://myproxy.example.org/nodejs/</downloadRoot>
-->
</configuration>
<!-- optional: default phase is "generate-resources" -->
<phase>generate-resources</phase>
</execution>
<execution>
<id>npm-install</id>
<goals>
<goal>npm</goal>
</goals>
<!-- optional: default phase is "generate-resources" -->
<phase>generate-resources</phase>
<configuration>
<!-- optional: The default argument is actually
"install", so unless you need to run some other npm command,
you can remove this whole <configuration> section.
-->
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>webpack-build</id>
<goals>
<goal>webpack</goal>
</goals>
<!-- optional: the default phase is "generate-resources" -->
<phase>generate-resources</phase>
<configuration>
<!-- optional: if not specified, it will run webpack's default
build (and you can remove this whole <configuration> section.) -->
<arguments>${webpack.args}</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- ========== WEBPACK PROFILE BEGIN ========== -->
<!-- This profile does the minimal work of just compiling TS files, so that we can run this profile, which is extremely fast (couple of seconds),
and then be able to simply refresh the browser and see the changes immediately without doing an actual full maven build -->
<profile>
<id>webpack</id>
<properties>
<webpack.args>--config webpack.dev.js</webpack.args>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<start-class>quanta.AppServer</start-class>
<java.version>11</java.version>
</properties>
<dependencies></dependencies>
<build>
<filters>
<filter>src/main/resources/application.properties</filter>
</filters>
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>public/node_modules/**</exclude>
<exclude>public/node/**</exclude>
</excludes>
<!-- I have resource filtering disabled for now because i don't need it, but if you turn it back on don't forget
to add 'resources:resources' to the maven command for inside VSCode AND also your prod builder shell script!!!
<filtering>true</filtering>
-->
</resource>
</resources>
<plugins>
<!--
WARNING: It appears that only ONE exec-maven-plugin runs. Having two of these plugins won't work, because it ends up
only running one of them. Don't know why. So just put ALL scripting stuff in this one file
-->
<!--
With this plugin commented out you must also remove 'exec:exec' from the maven build command line (goals)
and of course put 'exec:exec' back in if you are doing the exec-maven-plugin.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<executable>./run-webpack.sh</executable>
<workingDirectory>./</workingDirectory>
</configuration>
</plugin>
-->
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<!-- Use the latest released version:
https://repo1.maven.org/maven2/com/github/eirslett/frontend-maven-plugin/ -->
<version>1.12.0</version>
<configuration>
<workingDirectory>src/main/resources/public</workingDirectory>
</configuration>
<executions>
<execution>
<id>webpack-build</id>
<goals>
<goal>webpack</goal>
</goals>
<!-- optional: the default phase is "generate-resources" -->
<phase>generate-resources</phase>
<configuration>
<!-- optional: if not specified, it will run webpack's default
build (and you can remove this whole <configuration> section.) -->
<arguments>${webpack.args}</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>