Full name:

io.wcm.maven.plugins:nodejs-maven-plugin:3.0.9-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). Can be specified with or without "v" prefix.
Default: 10.15.3
User Property: nodejs.version

Optional Parameters

Name Type Since Description
<nodeJsDirectory> File - Default location where Node.js will be extracted to and run from
Default: ${java.io.tmpdir}/nodejs
User Property: nodejs.directory
<npmVersion> String - NPM version. If not set the NPM version that is bundled with Node.js is used.
User Property: nodejs.npm.version
<skip> boolean - If set to true all Node.js plugin operations are skipped.
User Property: nodejs.skip
<stopOnError> boolean - Stop maven build if error occurs.
Default: 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). Can be specified with or without "v" prefix.
  • 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.9-SNAPSHOT. Last Published: 2024-09-24.