Support of Modern Yarn (Yarn 2+)
sbernard31 opened this issue ยท 3 comments
Hi,
I'm currently using this maven plugin with classic-yarn
and this works well. ๐
Sooner or later, I consider to migrate to modern yarn (currently Yarn 4).
But it is not clear to me if this project support it (partially or fully).
I see this could work #928 but it seems that some are using workaround (jenkinsci/jenkins#5824 (comment))
So what is the current status ? and is there any plan about this ?
Thx ๐
I think it's at least partially supported. In the readme it states:
If your project is using Yarn Berry (2.x or above), the Yarn version is handled per project but a Yarn 1.x install is still needed as a "bootstrap". The plugin will try to detect .yarnrc.yml file in the current Maven project/module folder, at the root of the multi-module project if relevant, and in the folder from which the mvn command was run. If detected, the plugin will assume your project is using Yarn Berry. It will install the 1.x Yarn version you specify with yarnVersion as bootstrap, then hand over to your project-specific version.
Got added in https://github.com/eirslett/frontend-maven-plugin/pull/1012/files
That being said, i haven't tested it myself so i'm not 100% sure.
@123Haynes thx for you answer but I didn't get why Jenkins project seems to say it is missing something for full support :
- jenkinsci/jenkins#5824 (comment)
- https://github.com/jenkinsci/jenkins/pull/5824/files#diff-91ff25ed478e4186e5b4a784395ead002f4c14902f2b5ef716390a682e36ccf9R703-R728
(Note that #1012 seems very older than jenkinsci/jenkins#5824)
๐ค
Yarn 2, 3, 4 work perfectly fine. You just need to include executable into repository, so simply install classic yarn with maven-frontend-plugin and run yarn commands.
The problem that jenkins team is referencing is support for corepack distribution model, where you don't need to ship yarn berry executable inside of your repo. Yarn 4 switched to corepack by default.