From 516a569328b32e7b8a6f69b2f779ed79598d6adb Mon Sep 17 00:00:00 2001 From: khalilou88 <32600911+khalilou88@users.noreply.github.com> Date: Fri, 6 Oct 2023 17:28:58 +0200 Subject: [PATCH] feat(executors): add NX_SKIP_MAVEN_WRAPPER environment variable (#501) Co-authored-by: khalilou88 --- packages/nx-maven/src/utils/index.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/nx-maven/src/utils/index.ts b/packages/nx-maven/src/utils/index.ts index 990ff6500..bd7af6caf 100644 --- a/packages/nx-maven/src/utils/index.ts +++ b/packages/nx-maven/src/utils/index.ts @@ -11,13 +11,17 @@ import { readXml } from '@jnxplus/xml'; export function getExecutable() { let executable = ''; - const isWrapperExists = isWrapperExistsFunction(); - - if (isWrapperExists) { - const isWin = process.platform === 'win32'; - executable = isWin ? 'mvnw.cmd' : './mvnw'; - } else { + if (process.env['NX_SKIP_MAVEN_WRAPPER'] === 'true') { executable = 'mvn'; + } else { + const isWrapperExists = isWrapperExistsFunction(); + + if (isWrapperExists) { + const isWin = process.platform === 'win32'; + executable = isWin ? 'mvnw.cmd' : './mvnw'; + } else { + executable = 'mvn'; + } } if (process.env['NX_MAVEN_CLI_OPTS']) {