cds:npm
Full name:
com.sap.cds:cds-maven-plugin:3.4.0:npm
Description:
Execute an npm
command on the CAP Java project. For example, it can be used to perform an npm install
to install npm dependencies which are maintained in package.json.
Call mvn cds:npm -Darguments="..."
or mvn com.sap.cds:cds-maven-plugin:npm -Darguments="..."
to execute npm
with given arguments.
Attributes:
- Executes as an aggregator goal.
- The goal is not marked as thread-safe and thus does not support parallel builds.
- Since version:
1.7.0
. - Binds by default to the lifecycle phase:
initialize
.
Optional Parameters
Name | Type | Since | Description |
---|---|---|---|
<arguments> |
String |
- |
A line of space-separated arguments passed to npm for execution. For example: install -g .
Note: If this parameter is configured, it's not allowed to configure also the commands parameter.User Property: arguments |
<commands> |
List<String> |
3.0.0 |
A list of commands which are passed to npm for execution. Each command is a space-separated list of arguments. All commands are executed in the order they are defined.
If the execution of a command fails, the whole goal fails and the following commands are not run anymore. Note: If this parameter is configured, it's not allowed to configure also the arguments parameter.
An example with multiple commands:
User Property: cds.npm.commands |
<environmentVariables> |
Map<String,String> |
1.26.0 |
Additional environment variables to set on the command line. |
<npmRegistry> |
String |
- |
URL of NPM registry to use. User Property: cds.npm.registry |
<outputFile> |
File |
- |
Define an optional file to redirect standard and error output to. If not specified, the standard Maven logging is used. User Property: outputFile |
<skip> |
boolean |
- |
Skip execution of this goal. Default: false User Property: cds.npm.skip |
<workingDirectory> |
File |
- |
The working directory to use during npm command execution. If not specified, the goal uses the directory containing a .cdsrc.json or package.json file. It goes up the project hierarchy on the file system until one of these files is found or the top-level project directory is reached. |
Parameter Details
<arguments>
A line of space-separated arguments passed to
Note: If this parameter is configured, it's not allowed to configure also the
npm
for execution. For example: install -g
.
Note: If this parameter is configured, it's not allowed to configure also the
commands
parameter.- Type:
java.lang.String
- Required:
No
- User Property:
arguments
<commands>
A list of commands which are passed to
If the execution of a command fails, the whole goal fails and the following commands are not run anymore.
Note: If this parameter is configured, it's not allowed to configure also the
An example with multiple commands:
npm
for execution. Each command is a space-separated list of arguments. All commands are executed in the order they are defined.
If the execution of a command fails, the whole goal fails and the following commands are not run anymore.
Note: If this parameter is configured, it's not allowed to configure also the
arguments
parameter.
An example with multiple commands:
<commands>
<command>install</command>
<command>run hdi-deploy</command>
</commands>
- Type:
java.util.List<java.lang.String>
- Since:
3.0.0
- Required:
No
- User Property:
cds.npm.commands
<environmentVariables>
Additional environment variables to set on the command line.
- Type:
java.util.Map<java.lang.String, java.lang.String>
- Since:
1.26.0
- Required:
No
<npmRegistry>
URL of NPM registry to use.
- Type:
java.lang.String
- Required:
No
- User Property:
cds.npm.registry
<outputFile>
Define an optional file to redirect standard and error output to. If not specified, the standard Maven logging is used.
- Type:
java.io.File
- Required:
No
- User Property:
outputFile
<skip>
Skip execution of this goal.
- Type:
boolean
- Required:
No
- User Property:
cds.npm.skip
- Default:
false
<workingDirectory>
The working directory to use during
npm
command execution. If not specified, the goal uses the directory containing a .cdsrc.json or package.json file. It goes up the project hierarchy on the file system until one of these files is found or the top-level project directory is reached.- Type:
java.io.File
- Required:
No