From fb5261fbf6669802e4e45ff31da8781fd6091e37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E9=9B=A8=E8=90=BD?= Date: Sun, 15 Sep 2024 22:57:12 +0800 Subject: [PATCH 1/2] #1160 Property to select node path. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 秋雨落 --- .../maven/plugins/frontend/lib/NodeExecutorConfig.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend-plugin-core/src/main/java/com/github/eirslett/maven/plugins/frontend/lib/NodeExecutorConfig.java b/frontend-plugin-core/src/main/java/com/github/eirslett/maven/plugins/frontend/lib/NodeExecutorConfig.java index 80c743b1e..3669304cf 100644 --- a/frontend-plugin-core/src/main/java/com/github/eirslett/maven/plugins/frontend/lib/NodeExecutorConfig.java +++ b/frontend-plugin-core/src/main/java/com/github/eirslett/maven/plugins/frontend/lib/NodeExecutorConfig.java @@ -33,6 +33,11 @@ public InstallNodeExecutorConfig(InstallConfig installConfig) { @Override public File getNodePath() { + String nodePath = System.getProperty("nodeExecutablePath"); + if (nodePath != null) { + return new File(nodePath); + } + String nodeExecutable = getPlatform().isWindows() ? NODE_WINDOWS : NODE_DEFAULT; return new File(installConfig.getInstallDirectory() + nodeExecutable); } From 08490ba3c87e9c5a2e2c9404c6f307ddd490b659 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E9=9B=A8=E8=90=BD?= Date: Sun, 15 Sep 2024 23:06:01 +0800 Subject: [PATCH 2/2] Add document about nodeExecutablePath. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 秋雨落 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 908678b2a..5942d0873 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,7 @@ to see how it should be set up: https://github.com/eirslett/frontend-maven-plugi - [Ignoring Failure](#ignoring-failure) - [Skipping Execution](#skipping-execution) + **Recommendation:** _Try to run all your tasks via npm scripts instead of running bower, grunt, gulp etc. directly._ ### Installing node and npm @@ -83,6 +84,7 @@ The versions of Node and npm are downloaded from https://nodejs.org/dist, extrac in your [installation directory](#installation-directory) . Node/npm will only be "installed" locally to your project. It will not be installed globally on the whole system (and it will not interfere with any Node/npm installations already present). +If you want to use the existing Node in your system, simply add a `nodeExecutablePath` points to the existed node executable. ```xml