Open Gamadril opened 2 years ago
Set the args on the task itself, no need for doFirst
tasks.npmSetup {
args.addAll(['--registry', 'http://myregistry.npm.com'])
}
Without doFirst the args are accepted -> FAQ should be updated for v3. However v3 seems not to work with our nexusIQ server. v2 works.
3.1.1:
npm info using npm@8.1.2
npm info using node@v16.13.1
...
npm verb stack HttpErrorGeneral: 404 Not Found - GET http://nexusiq.local:8081/nexus/content/groups/npm-all/npm
2.2.4:
npm info using npm@8.1.2
npm info using node@v16.13.1
...
npm http fetch GET 200 http://nexusiq.local:8081/nexus/content/groups/npm-all/npm 1094ms (cache updated)
same URL - different behaviour between v2 and v3. URL can be opened in a browser.
Any proxies involved in the mix? Might be worth trying with ProxySettings.OFF
Thanks. nodeProxySettings = ProxySettings.OFF
did it.
I can recommend adding your local nexus to nonProxyHosts
and turning on proxy support again, even if things work :-)
I have this problem because of the following code:
// "args" has to be set at exec time, because the schema files won't
// have been generated at config time.
doFirst {
args = [
'run', 'dtsgen',
"--", // separator, all args after this go to the script
"--out", "$generatedTsInterfaceFile",
// can't use fileTree here anymore, too many schema files
"$generatedTsJsonSchemaDir/*" ]
}
So this will be easy enough to refactor because I'm not using fileTree
any more to enumerate the files at rutime. The comment about "has to be set at exec time" is no longer true, so I can just get rid of the doFirst
and the block executes at config time.
Just thought I'd submit it as an example.
Also had a problem where I had code like:
args baseArgs
args += prodArgs
That was reasonably easily refactored though.
When I try to add registry parameter for npmSetup Task according to FAQ:
I get an error running npmSetup:
plugin version: 3.1.1