angular - 如何使用 maven-exec-plugin 进行 npm clean?
问题描述
我正在使用 exec-maven-plugin。我有 npm install 和 npm clean 的扩展。下面是我在 pom 文件中的插件部分。它包含 npm install 、 tsc run 和 npm clean 的扩展。
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>npm run clean (clean)</id>
<goals>
<goal>exec</goal>
</goals>
<phase>clean</phase>
<configuration>
<workingDirectory>./src/</workingDirectory>
<executable>npm</executable>
<arguments>
<argument>clean</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
但是当我做 maven-package 时,它给出了以下错误:
Usage: npm <command>
where <command> is one of:
access, adduser, audit, bin, bugs, c, cache, ci, cit,
clean-install, clean-install-test, completion, config,
create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
edit, explore, get, help, help-search, hook, i, init,
install, install-ci-test, install-test, it, link, list, ln,
login, logout, ls, org, outdated, owner, pack, ping, prefix,
profile, prune, publish, rb, rebuild, repo, restart, root,
run, run-script, s, se, search, set, shrinkwrap, star,
stars, start, stop, t, team, test, token, tst, un,
uninstall, unpublish, unstar, up, update, v, version, view,
whoami
npm <command> -h quick help on <command>
npm -l display full usage info
npm help <term> search for help on <term>
npm help npm involved overview
Specify configs in the ini-formatted file:
/home/user/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
npm@6.10.2 /usr/lib/node_modules/npm
[ERROR] Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.541 s
[INFO] Finished at: 2019-09-25T11:47:14+02:00
[INFO] Final Memory: 8M/40M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (npm run clean (clean)) on project
有人可以帮我吗?
提前致谢。
解决方案
您可以在列表中看到该命令没有clean
可用的参数。npm
Usage: npm <command>
where <command> is one of:
access, adduser, audit, bin, bugs, c, cache, ci, cit,
clean-install, clean-install-test, completion, config,
create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
edit, explore, get, help, help-search, hook, i, init,
install, install-ci-test, install-test, it, link, list, ln,
login, logout, ls, org, outdated, owner, pack, ping, prefix,
profile, prune, publish, rb, rebuild, repo, restart, root,
run, run-script, s, se, search, set, shrinkwrap, star,
stars, start, stop, t, team, test, token, tst, un,
uninstall, unpublish, unstar, up, update, v, version, view,
whoami
npm <command> -h quick help on <command>
npm -l display full usage info
npm help <term> search for help on <term>
npm help npm involved overview
[ERROR] Command execution failed.
您可以寻找npm-clean
或mvn clean
。
推荐阅读
- python - 转换值列表以用作字典键
- swift - `withAnimation` 仅在将第一项添加到 @State 数组时执行一次动画
- javascript - 将服务函数引用传递给子组件
- lua - 为什么我的 LUA 解释器不能处理字符串键值?
- layout - 如何在不包含 JS/bootstrap 的情况下更改 cflayoutarea 的折叠方向?
- google-app-maker - 数据源使用什么版本的mysql?
- dialogflow-es - 如何在对话流中的一段时间后调用事件
- office-js - Script Lab 收集什么样的数据(如果有)?
- sql - SQL:发生某事时从字符串中获取所有值
- android - 在 Android 中使用 GridView 是否安全?