Skip to content

Commit bcefcc5

Browse files
StefanSpiekerbasil
andauthored
[JENKINS-68699] Upgrade Yarn from 1.22.19 to 3.2.0 (jenkinsci#5824)
Co-authored-by: Basil Crow <[email protected]>
1 parent 4872065 commit bcefcc5

File tree

5 files changed

+11203
-7866
lines changed

5 files changed

+11203
-7866
lines changed

.gitattributes

+4
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,7 @@
3838
*.png binary
3939
*.war binary
4040
*.zip binary
41+
42+
# Yarn
43+
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
44+
/war/.yarn/plugins/** binary

war/.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ work
22
/rebel.xml
33
junit.xml
44

5+
# Yarn
6+
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
7+
.pnp.*
8+
.yarn/*
9+
!.yarn/patches
10+
!.yarn/plugins
11+
!.yarn/sdks
12+
!.yarn/versions
13+
514
# Node
615
node/
716
node_modules/

war/.yarnrc.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Defines what linker should be used for installing Node packages (useful to
2+
# enable the node-modules plugin), one of: pnp, pnpm and node-modules.
3+
nodeLinker: node-modules
4+
5+
# The yarnPath setting is currently the preferred way to install Yarn within a
6+
# project, as it ensures that your whole team will use the exact same Yarn
7+
# version, without having to individually keep it up-to-date.
8+
yarnPath: .yarn/releases/yarn-3.2.0.cjs

war/pom.xml

+30-5
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ THE SOFTWARE.
4747
<!-- HTTP listener port -->
4848
<port>8080</port>
4949
<node.version>16.15.1</node.version>
50+
<!-- frontend-maven-plugin will install this Yarn version as bootstrap, then hand over control to Yarn Berry. -->
5051
<yarn.version>1.22.19</yarn.version>
52+
<!-- maven-antrun-plugin will download this Yarn version. -->
53+
<yarn-berry.version>3.2.0</yarn-berry.version>
54+
<yarn-berry.sha256sum>99a7f42f678b8ccd9c8e97a9e65fe7a5043033dd0e074e6d1f13fbe2d5ff2734</yarn-berry.sha256sum>
5155
</properties>
5256

5357
<dependencyManagement>
@@ -696,6 +700,32 @@ THE SOFTWARE.
696700
</execution>
697701
</executions>
698702
</plugin>
703+
<plugin>
704+
<groupId>org.apache.maven.plugins</groupId>
705+
<artifactId>maven-antrun-plugin</artifactId>
706+
<executions>
707+
<execution>
708+
<id>download-yarn</id>
709+
<goals>
710+
<goal>run</goal>
711+
</goals>
712+
<phase>initialize</phase>
713+
<configuration>
714+
<tasks>
715+
<property name="yarn.dest" value="${project.basedir}/.yarn/releases/yarn-${yarn-berry.version}.cjs" />
716+
<dirname file="${yarn.dest}" property="yarn.dest.dir" />
717+
<mkdir dir="${yarn.dest.dir}" />
718+
<get dest="${yarn.dest}" src="https://repo.yarnpkg.com/${yarn-berry.version}/packages/yarnpkg-cli/bin/yarn.js" usetimestamp="true" />
719+
<checksum algorithm="SHA-256" file="${yarn.dest}" property="${yarn-berry.sha256sum}" verifyProperty="yarn.checksum.matches" />
720+
<condition property="yarn.checksum.matches.fail">
721+
<equals arg1="${yarn.checksum.matches}" arg2="false" />
722+
</condition>
723+
<fail if="yarn.checksum.matches.fail">Checksum error</fail>
724+
</tasks>
725+
</configuration>
726+
</execution>
727+
</executions>
728+
</plugin>
699729
<plugin>
700730
<groupId>com.github.eirslett</groupId>
701731
<artifactId>frontend-maven-plugin</artifactId>
@@ -722,11 +752,6 @@ THE SOFTWARE.
722752
<goal>yarn</goal>
723753
</goals>
724754
<phase>initialize</phase>
725-
<configuration>
726-
<!-- ensure only one concurrent 'yarn install' -->
727-
<!-- when yarn cache is empty, multiple yarns performing network fetches frequently results in opaque errors -->
728-
<arguments>--mutex network</arguments>
729-
</configuration>
730755
</execution>
731756

732757
<execution>

0 commit comments

Comments
 (0)