Full name:

io.wcm.maven.plugins:nodejs-maven-plugin:3.0.7-SNAPSHOT:run

Description:

Executes the run goal of the plugin

Attributes:

  • Requires a Maven project to be executed.
  • The goal is not marked as thread-safe and thus does not support parallel builds.
  • Binds by default to the lifecycle phase: process-sources.

Required Parameters

Name Type Since Description
<nodeJsVersion> String - Node.js version (minimum version: 6.3.0).
Default value is: 10.15.3.
User property is: nodejs.version.

Optional Parameters

Name Type Since Description
<nodeJsDirectory> File - Default location where Node.js will be extracted to and run from
Default value is: ${java.io.tmpdir}/nodejs.
User property is: nodejs.directory.
<npmVersion> String - NPM version. If not set the NPM version that is bundled with Node.js is used.
User property is: nodejs.npm.version.
<skip> boolean - If set to true all Node.js plugin operations are skipped.
User property is: nodejs.skip.
<stopOnError> boolean - Stop maven build if error occurs.
Default value is: true.
<tasks> List<Task> - Tasks that should be run on Node.js execution.

You can define different types of tasks: npmInstallTask or nodeJsTask items.

Example 1:

<tasks>
  <npmInstallTask>
    <workingDirectory>${frontend.dir}</workingDirectory>
  </npmInstallTask>
  <nodeJsTask>
    <workingDirectory>${frontend.dir}</workingDirectory>
    <moduleName>grunt-cli</moduleName>
    <executableName>grunt</executableName>
    <arguments>
      <argument>build</argument>
    </arguments>
  </nodeJsTask>
</tasks>

Example 2:

<tasks>
  <npmInstallTask>
    <workingDirectory>${frontend.dir}</workingDirectory>
  </npmInstallTask>
  <nodeJsTask>
    <workingDirectory>${frontend.dir}</workingDirectory>
    <moduleName>npm</moduleName>
    <executableName>npm-cli</executableName>
    <arguments>
      <argument>run</argument>
      <argument>test</argument>
    </arguments>
  </nodeJsTask>
</tasks>

Parameter Details

<nodeJsDirectory>

Default location where Node.js will be extracted to and run from
  • Type: java.io.File
  • Required: No
  • User Property: nodejs.directory
  • Default: ${java.io.tmpdir}/nodejs

<nodeJsVersion>

Node.js version (minimum version: 6.3.0).
  • Type: java.lang.String
  • Required: Yes
  • User Property: nodejs.version
  • Default: 10.15.3

<npmVersion>

NPM version. If not set the NPM version that is bundled with Node.js is used.
  • Type: java.lang.String
  • Required: No
  • User Property: nodejs.npm.version

<skip>

If set to true all Node.js plugin operations are skipped.
  • Type: boolean
  • Required: No
  • User Property: nodejs.skip

<stopOnError>

Stop maven build if error occurs.
  • Type: boolean
  • Required: No
  • Default: true

<tasks>

Tasks that should be run on Node.js execution.

You can define different types of tasks: npmInstallTask or nodeJsTask items.

Example 1:

<tasks>
  <npmInstallTask>
    <workingDirectory>${frontend.dir}</workingDirectory>
  </npmInstallTask>
  <nodeJsTask>
    <workingDirectory>${frontend.dir}</workingDirectory>
    <moduleName>grunt-cli</moduleName>
    <executableName>grunt</executableName>
    <arguments>
      <argument>build</argument>
    </arguments>
  </nodeJsTask>
</tasks>

Example 2:

<tasks>
  <npmInstallTask>
    <workingDirectory>${frontend.dir}</workingDirectory>
  </npmInstallTask>
  <nodeJsTask>
    <workingDirectory>${frontend.dir}</workingDirectory>
    <moduleName>npm</moduleName>
    <executableName>npm-cli</executableName>
    <arguments>
      <argument>run</argument>
      <argument>test</argument>
    </arguments>
  </nodeJsTask>
</tasks>
  • Type: java.util.List<? extends io.wcm.maven.plugins.nodejs.mojo.Task>
  • Required: No

Back to top

Version: 3.0.7-SNAPSHOT. Last Published: 2023-10-17.