@Mojo(name="exec",
threadSafe=true,
defaultPhase=COMPILE)
public class NpmMojo
extends AbstractMojo
| Modifier and Type | Field and Description |
|---|---|
private String[] |
args
The arguments to pass to npm command.
|
private String |
command
The npm command to execute, such as 'install', 'test', etc.
|
private File |
npmHome
The directory that contains npm executable.
|
private File |
workingDir
The working directory.
|
| Constructor and Description |
|---|
NpmMojo() |
| Modifier and Type | Method and Description |
|---|---|
private org.apache.commons.exec.CommandLine |
addArguments(org.apache.commons.exec.CommandLine cmdLine) |
private org.apache.commons.exec.CommandLine |
addCommand(org.apache.commons.exec.CommandLine cmdLine) |
void |
execute() |
private void |
execute(org.apache.commons.exec.CommandLine cmdLine) |
protected static void |
execute(org.apache.commons.exec.CommandLine cmdLine,
File workingDir,
boolean useLogHandler,
org.apache.maven.plugin.logging.Log log,
Level level) |
private org.apache.commons.exec.CommandLine |
getNpmCommand() |
getCommand, isWindows, logLevel, parseArgument, useLogHandler@Parameter(property="npm.command") private String command
@Parameter(property="npm.args") private String[] args
@Parameter(property="npm.workingDir",
defaultValue="${basedir}")
private File workingDir
@Parameter(property="npm.home") private File npmHome
public void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionprivate void execute(org.apache.commons.exec.CommandLine cmdLine)
throws org.apache.maven.plugin.MojoFailureException,
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureExceptionorg.apache.maven.plugin.MojoExecutionExceptionprotected static void execute(org.apache.commons.exec.CommandLine cmdLine,
File workingDir,
boolean useLogHandler,
org.apache.maven.plugin.logging.Log log,
Level level)
throws org.apache.maven.plugin.MojoFailureException,
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureExceptionorg.apache.maven.plugin.MojoExecutionExceptionprivate org.apache.commons.exec.CommandLine addCommand(org.apache.commons.exec.CommandLine cmdLine)
private org.apache.commons.exec.CommandLine addArguments(org.apache.commons.exec.CommandLine cmdLine)
private org.apache.commons.exec.CommandLine getNpmCommand()
Copyright © 2020. All rights reserved.