Skip to content

Commit

Permalink
[JENKINS-68699] Upgrade Yarn from 1.22.19 to 3.2.0 (#5824)
Browse files Browse the repository at this point in the history
Co-authored-by: Basil Crow <me@basilcrow.com>
  • Loading branch information
StefanSpieker and basil committed Jul 21, 2022
1 parent 4872065 commit bcefcc5
Show file tree
Hide file tree
Showing 5 changed files with 11,203 additions and 7,866 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Expand Up @@ -38,3 +38,7 @@
*.png binary
*.war binary
*.zip binary

# Yarn
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
/war/.yarn/plugins/** binary
9 changes: 9 additions & 0 deletions war/.gitignore
Expand Up @@ -2,6 +2,15 @@ work
/rebel.xml
junit.xml

# Yarn
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/sdks
!.yarn/versions

# Node
node/
node_modules/
Expand Down
8 changes: 8 additions & 0 deletions war/.yarnrc.yml
@@ -0,0 +1,8 @@
# Defines what linker should be used for installing Node packages (useful to
# enable the node-modules plugin), one of: pnp, pnpm and node-modules.
nodeLinker: node-modules

# The yarnPath setting is currently the preferred way to install Yarn within a
# project, as it ensures that your whole team will use the exact same Yarn
# version, without having to individually keep it up-to-date.
yarnPath: .yarn/releases/yarn-3.2.0.cjs
35 changes: 30 additions & 5 deletions war/pom.xml
Expand Up @@ -47,7 +47,11 @@ THE SOFTWARE.
<!-- HTTP listener port -->
<port>8080</port>
<node.version>16.15.1</node.version>
<!-- frontend-maven-plugin will install this Yarn version as bootstrap, then hand over control to Yarn Berry. -->
<yarn.version>1.22.19</yarn.version>
<!-- maven-antrun-plugin will download this Yarn version. -->
<yarn-berry.version>3.2.0</yarn-berry.version>
<yarn-berry.sha256sum>99a7f42f678b8ccd9c8e97a9e65fe7a5043033dd0e074e6d1f13fbe2d5ff2734</yarn-berry.sha256sum>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -696,6 +700,32 @@ THE SOFTWARE.
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>download-yarn</id>
<goals>
<goal>run</goal>
</goals>
<phase>initialize</phase>
<configuration>
<tasks>
<property name="yarn.dest" value="${project.basedir}/.yarn/releases/yarn-${yarn-berry.version}.cjs" />
<dirname file="${yarn.dest}" property="yarn.dest.dir" />
<mkdir dir="${yarn.dest.dir}" />
<get dest="${yarn.dest}" src="https://repo.yarnpkg.com/${yarn-berry.version}/packages/yarnpkg-cli/bin/yarn.js" usetimestamp="true" />
<checksum algorithm="SHA-256" file="${yarn.dest}" property="${yarn-berry.sha256sum}" verifyProperty="yarn.checksum.matches" />
<condition property="yarn.checksum.matches.fail">
<equals arg1="${yarn.checksum.matches}" arg2="false" />
</condition>
<fail if="yarn.checksum.matches.fail">Checksum error</fail>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
Expand All @@ -722,11 +752,6 @@ THE SOFTWARE.
<goal>yarn</goal>
</goals>
<phase>initialize</phase>
<configuration>
<!-- ensure only one concurrent 'yarn install' -->
<!-- when yarn cache is empty, multiple yarns performing network fetches frequently results in opaque errors -->
<arguments>--mutex network</arguments>
</configuration>
</execution>

<execution>
Expand Down

0 comments on commit bcefcc5

Please sign in to comment.