Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support of Modern Yarn (Yarn 2+) #1126

Open
sbernard31 opened this issue Nov 28, 2023 · 3 comments
Open

Support of Modern Yarn (Yarn 2+) #1126

sbernard31 opened this issue Nov 28, 2023 · 3 comments

Comments

@sbernard31
Copy link

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 馃檹

@123Haynes
Copy link

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.

@sbernard31
Copy link
Author

@123Haynes thx for you answer but I didn't get why Jenkins project seems to say it is missing something for full support :

(Note that #1012 seems very older than jenkinsci/jenkins#5824)

馃

@betalb
Copy link

betalb commented Jan 16, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants