@@ -98,6 +98,12 @@ THE SOFTWARE.
98
98
<spotless .check.skip>false</spotless .check.skip>
99
99
<!-- Make sure to keep the jetty-ee9-maven-plugin version in war/pom.xml in sync with the Jetty release in Winstone: -->
100
100
<winstone .version>8.1</winstone .version>
101
+ <node .version>20.17.0</node .version>
102
+ <!-- frontend-maven-plugin will install this Yarn version as bootstrap, then hand over control to Yarn Berry. -->
103
+ <yarn .version>1.22.19</yarn .version>
104
+ <!-- maven-antrun-plugin will download this Yarn version. -->
105
+ <yarn-berry .version>4.4.1</yarn-berry .version>
106
+ <yarn-berry .sha256sum>920b4530755296dc2ce8b4351f057d4a26429524fcb2789d277560d94837c27e</yarn-berry .sha256sum>
101
107
</properties >
102
108
103
109
<!--
@@ -415,5 +421,192 @@ THE SOFTWARE.
415
421
<changelog .url>https://www.jenkins.io/changelog-stable</changelog .url>
416
422
</properties >
417
423
</profile >
424
+ <profile >
425
+ <id >yarn-ci-lint</id >
426
+ <activation >
427
+ <property >
428
+ <name >env.CI</name >
429
+ </property >
430
+ <file >
431
+ <exists >package.json</exists >
432
+ </file >
433
+ </activation >
434
+ <build >
435
+ <plugins >
436
+ <plugin >
437
+ <groupId >com.github.eirslett</groupId >
438
+ <artifactId >frontend-maven-plugin</artifactId >
439
+ <version >1.15.0</version >
440
+ <executions >
441
+ <execution >
442
+ <id >yarn lint:ci</id >
443
+ <goals >
444
+ <goal >yarn</goal >
445
+ </goals >
446
+ <configuration >
447
+ <arguments >lint:ci</arguments >
448
+ <skip >${yarn.lint.skip} </skip >
449
+ </configuration >
450
+ </execution >
451
+ </executions >
452
+ </plugin >
453
+ </plugins >
454
+ </build >
455
+ </profile >
456
+ <profile >
457
+ <id >yarn-lint</id >
458
+ <activation >
459
+ <property >
460
+ <name >!env.CI</name >
461
+ </property >
462
+ <file >
463
+ <exists >package.json</exists >
464
+ </file >
465
+ </activation >
466
+ <build >
467
+ <plugins >
468
+ <plugin >
469
+ <groupId >com.github.eirslett</groupId >
470
+ <artifactId >frontend-maven-plugin</artifactId >
471
+ <version >1.15.0</version >
472
+ <executions >
473
+ <execution >
474
+ <id >yarn lint</id >
475
+ <goals >
476
+ <goal >yarn</goal >
477
+ </goals >
478
+ <configuration >
479
+ <arguments >lint</arguments >
480
+ <skip >${yarn.lint.skip} </skip >
481
+ </configuration >
482
+ </execution >
483
+ </executions >
484
+ </plugin >
485
+ </plugins >
486
+ </build >
487
+ </profile >
488
+ <profile >
489
+ <id >yarn-execution</id >
490
+ <activation >
491
+ <file >
492
+ <exists >package.json</exists >
493
+ </file >
494
+ </activation >
495
+ <build >
496
+ <plugins >
497
+ <plugin >
498
+ <groupId >org.apache.maven.plugins</groupId >
499
+ <artifactId >maven-antrun-plugin</artifactId >
500
+ <executions >
501
+ <execution >
502
+ <id >download-yarn</id >
503
+ <goals >
504
+ <goal >run</goal >
505
+ </goals >
506
+ <phase >initialize</phase >
507
+ <configuration >
508
+ <target >
509
+ <property name =" yarn.dest" value =" ${project.basedir}/.yarn/releases/yarn-${yarn-berry.version}.cjs" />
510
+ <dirname file =" ${yarn.dest}" property =" yarn.dest.dir" />
511
+ <mkdir dir =" ${yarn.dest.dir}" />
512
+ <get dest =" ${yarn.dest}" src =" https://repo.yarnpkg.com/${yarn-berry.version}/packages/yarnpkg-cli/bin/yarn.js" usetimestamp =" true" />
513
+ <checksum algorithm =" SHA-256" file =" ${yarn.dest}" property =" ${yarn-berry.sha256sum}" verifyProperty =" yarn.checksum.matches" />
514
+ <condition property =" yarn.checksum.matches.fail" >
515
+ <equals arg1 =" ${yarn.checksum.matches}" arg2 =" false" />
516
+ </condition >
517
+ <fail if =" yarn.checksum.matches.fail" >Checksum error</fail >
518
+ <echo file =" ${project.basedir}/.yarnrc.yml" >yarnPath: ${yarn.dest} </echo >
519
+ </target >
520
+ </configuration >
521
+ </execution >
522
+ </executions >
523
+ </plugin >
524
+ <plugin >
525
+ <groupId >com.github.eirslett</groupId >
526
+ <artifactId >frontend-maven-plugin</artifactId >
527
+ <version >1.15.0</version >
528
+ <executions >
529
+
530
+ <execution >
531
+ <id >install node and yarn</id >
532
+ <goals >
533
+ <goal >install-node-and-yarn</goal >
534
+ </goals >
535
+ <phase >initialize</phase >
536
+ <configuration >
537
+ <nodeVersion >v${node.version} </nodeVersion >
538
+ <yarnVersion >v${yarn.version} </yarnVersion >
539
+ <nodeDownloadRoot >https://repo.jenkins-ci.org/nodejs-dist/</nodeDownloadRoot >
540
+ <!-- tried to create a mirror for yarnDownloadRoot but it did not work -->
541
+ </configuration >
542
+ </execution >
543
+
544
+ <execution >
545
+ <id >yarn install</id >
546
+ <goals >
547
+ <goal >yarn</goal >
548
+ </goals >
549
+ <phase >initialize</phase >
550
+ </execution >
551
+
552
+ <execution >
553
+ <id >yarn build</id >
554
+ <goals >
555
+ <goal >yarn</goal >
556
+ </goals >
557
+ <phase >generate-sources</phase >
558
+ <configuration >
559
+ <arguments >build</arguments >
560
+ </configuration >
561
+ </execution >
562
+
563
+ <execution >
564
+ <id >yarn lint</id >
565
+ <goals >
566
+ <goal >yarn</goal >
567
+ </goals >
568
+ <configuration >
569
+ <arguments >lint:ci</arguments >
570
+ <skip >${yarn.lint.skip} </skip >
571
+ </configuration >
572
+ </execution >
573
+ </executions >
574
+ </plugin >
575
+ </plugins >
576
+ </build >
577
+ </profile >
578
+
579
+ <profile >
580
+ <id >clean-node</id >
581
+ <activation >
582
+ <property >
583
+ <name >cleanNode</name >
584
+ </property >
585
+ <file >
586
+ <exists >package.json</exists >
587
+ </file >
588
+ </activation >
589
+ <build >
590
+ <plugins >
591
+ <plugin >
592
+ <groupId >org.apache.maven.plugins</groupId >
593
+ <artifactId >maven-clean-plugin</artifactId >
594
+ <!-- Version specified in grandparent POM -->
595
+ <configuration >
596
+ <filesets >
597
+ <fileset >
598
+ <directory >node</directory >
599
+ <followSymlinks >false</followSymlinks >
600
+ </fileset >
601
+ <fileset >
602
+ <directory >node_modules</directory >
603
+ <followSymlinks >false</followSymlinks >
604
+ </fileset >
605
+ </filesets >
606
+ </configuration >
607
+ </plugin >
608
+ </plugins >
609
+ </build >
610
+ </profile >
418
611
</profiles >
419
612
</project >
0 commit comments