frontend-maven-plugin
frontend-maven-plugin copied to clipboard
please document how to set Yarn's npm registry
Do you want to request a feature or report a bug? feature/documentation
What is the current behavior? docs are insufficient to solve issue
If the current behavior is a bug, please provide the steps to reproduce. I've tried everything I could think of to get "yarn install" to use our internal artifactory registry w/o luck:
- added registry in .yarnrc in project root and webclient folder
- ran the maven command "yarn config set registry" as a command for the plugin before "yarn install"
- passing "--registry" to the "yarn install" command
- added "<yarnInheritsProxyConfigFromMaven>false</yarnInheritsProxyConfigFromMaven>" to the configuration
What is the expected behavior? running "yarn set config registry" as a command should have worked but it did not
Please mention your frontend-maven-plugin and operating system version. OSX Big Sur frontend-maven-plugin 1.11.3
Idk, I don't use yarn... 🤷 maybe if somebody who uses yarn can help out, and also at the same time write some docs about it, that would be great!
Does it work for you if you run yarn directly, without the Maven plugin? Is it a problem with the Maven plugin, or a problem with yarn?
I don't understand how the plugin calls yarn properly unfortunately. You mean run the yarn command directly from maven w/o the plugin?
No, I mean call yarn directly without Maven.
Make sure your yarn.lock-file entries use your artifactory’s urls; yarn will fetch from the registry defined there.
Yarn will read .npmrc, so create it, if you haven’t already, and set your registry in there instead. I couldn’t get yarn to pick up registry settings in .yarnrc properly.
If you require authentication for your artifactory, also set ‘always-auth=true’
Thanks @paleite, you're a lifesaver. The reason was indeed the yarn-lock file. I deleted it and added it to my .gitignore. yarn actually renamed their .yarnrc file FYI....it's now .yarnrc.yaml. I just ended up adding a yarn command to set the registry in my pom.xml instead.
Should I put up a PR w/ extra docs on the yarn setup piece of this? Feels like it could save people some pain... 😂
Yes please! Some helper/debug/troubleshooting info under "Running Yarn" maybe.
added https://github.com/eirslett/frontend-maven-plugin/pull/964
Hopefully that's clear enough?