首页 > 解决方案 > 如何在构建 Maven 项目时设置目标路径?

问题描述

我正在尝试将节点和 npm 安装到特定位置,但路径自动设置为“C:/Users.../webapp/node/node.exe”并且节点目录不存在。所以我想知道是否有一种方法可以改变路径,以便我可以将所有东西安装在正确的位置。

这是我运行 Maven 构建时出现的命令提示符消息: --- frontend-maven-plugin:1.3:install-node-and-npm (install node and npm) @ webside --- [INFO] 安装节点版本v8.12.0 [INFO] 将节点二进制文件从 C:\Users\Q1011804.m2\repository\com\github\eirslett\node\8.12.0\node-8.12.0-win-x64.exe 复制到 C:\Users\ Q1011804\eclipse-workspace\par ent\webside\src\main\webapp\node\node.exe [错误] 无法执行目标 com.github.eirslett:frontend-maven-plugin:1.3:install-node-and-npm项目webside(安装node和npm):Could not install Node.js: C:\Users\Q1011804\eclipse-workspace\parent\webside\src\main\webapp\node\node.exe(系统找不到路径指定)-> [帮助 1]

标签: node.jseclipsemavennpm

解决方案


我想你需要添加

<configuration>
     <installDirectory>someDir</installDirectory>
</configuration>    

到您的 pom.xml 中的插件定义。


推荐阅读