Registry
Summary
The registries configure publication targets and their authentication. For each configured NpmRegistry
and NpmPackage
combination,
a unique publish<PackageName>PackageTo<RegistryName>Registry
NpmPublishTask will be
generated and added as a dependency to the publish
lifecycle task.
The registries can be accessed and configured from a build.gradle.kts
file via npmPublish::registries
invocation.
Shortcuts
Some shortcuts are also available for common npm registries. These shortcuts simply name the registry and sets the appropriate uri for you. The names of the registries match the DSL name. Finally, the shortcuts are repeatable and will detect and configure existing registries on subsequent invocations.
build.gradle.kts | |
---|---|
Properties
Property | Type | Default | When Kotlin plugin is present |
---|---|---|---|
access |
NpmAccess | NpmPublishExtension::access |
|
dry |
NpmAccess | NpmPublishExtension::dry |
|
uri |
URI | ||
otp |
String | ||
authToken |
String | ||
auth |
String | ||
username |
String | ||
password |
String | ||
npmrc |
RegularFile | NpmPublishExtension::npmrc |
Property | CLI | System/Gradle | Environment |
---|---|---|---|
access |
npm.publish.registry.<name>.access |
NPM_PUBLISH_REGISTRY_<NAME>_ACCESS |
|
dry |
npm.publish.registry.<name>.dry |
NPM_PUBLISH_REGISTRY_<NAME>_DRY |
|
uri |
npm.publish.registry.<name>.uri |
NPM_PUBLISH_REGISTRY_<NAME>_URI |
|
otp |
npm.publish.registry.<name>.otp |
NPM_PUBLISH_REGISTRY_<NAME>_OTP |
|
authToken |
npm.publish.registry.<name>.authToken |
NPM_PUBLISH_REGISTRY_<NAME>_AUTHTOKEN |
|
auth |
npm.publish.registry.<name>.auth |
NPM_PUBLISH_REGISTRY_<NAME>_AUTH |
|
username |
npm.publish.registry.<name>.username |
NPM_PUBLISH_REGISTRY_<NAME>_USERNAME |
|
password |
npm.publish.registry.<name>.password |
NPM_PUBLISH_REGISTRY_<NAME>_PASSWORD |
|
npmrc |
npm.publish.registry.<name>.npmrc |
NPM_PUBLISH_REGISTRY_<NAME>_NPMRC |
uri
can also be set from String asuri.set("https://registry.npmjs.org")
in which case the plugin will construct an URI instance from the string for you- Only one of
authToken
,auth
orusername
+password
should be specified.
access
Registry access. More info
dry
Overrides NpmPublishExtension::dry value for this registry
uri
NPM registry uri to publish packages to. Should include schema domain and path if required. Can be set from URI
or String
otp
Optional OTP to use when authenticating with the registry
authToken
Auth token to use when authenticating with the registry. More info
Note
Only one of authToken
, auth
or username
+ password
should be provided.
auth
Base64 authentication string when authenticating with the registry.
Note
Only one of authToken
, auth
or username
+ password
should be provided.
username
Username to use when authenticating with the registry. Should always be specified together with a password.
Note
Only one of authToken
, auth
or username
+ password
should be provided.
password
Password to use when authenticating with the registry. Should always be specified together with a username.
Note
Only one of authToken
, auth
or username
+ password
should be provided.
npmrc
An optional .npmrc
to use when publishing packages to this registry.