Document how to specify the npm registry
A common need when using npm-based applications like Antora is to specify a custom npm registry (often a mirror or facade of central). The docs for the Antora Maven plugin should explain how to specify this location.
Even without introducing a dedicated parameter, it's already possible to specify the npm registry using an environment variable defined either when running Maven or in the environmentVariables
parameter. For example:
<configuration>
<npm_config_registry>https://registry.yarnpkg.com</npm_config_registry>
</configuration>
We considered introducing a dedicated parameter named npmRegistry
that gets translated into the --registry
option when invoking npm or npx. However, under the covers, npm ends up translating this option to the npm_config_registry
environment variable anyway, so it's simpler just to stick with that assignment in the first place.
With that said, this isn't just a documentation issue. The frontend-maven-plugin provides a parameter for setting that npm registry that's mapped to the npmRegistryURL
user property. However, this parameter is applied incorrectly when running npx (see https://github.com/eirslett/frontend-maven-plugin/pull/1120#issuecomment-2051358680), which ends up breaking the Antora call. This plugin needs to protect against that by preventing this parameter from being set.