Skip to content

Commit

Permalink
feat(executors): always set NX_MAVEN_CLI_OPTS (#343)
Browse files Browse the repository at this point in the history
Co-authored-by: khalilou88 <[email protected]>
  • Loading branch information
khalilou88 and khalilou88 authored Jul 27, 2023
1 parent 5980d91 commit 85a1f5d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
4 changes: 0 additions & 4 deletions packages/maven/src/executors/build-image/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ export default async function runExecutor(

let command = getExecutable();

if (process.env['NX_MAVEN_CLI_OPTS']) {
command += ` ${process.env['NX_MAVEN_CLI_OPTS']}`;
}

if (
getPluginName(context) === '@jnxplus/nx-boot-maven' ||
options.framework === 'spring-boot'
Expand Down
8 changes: 0 additions & 8 deletions packages/maven/src/executors/build/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ export default async function runExecutor(
) {
logger.info(`Executor ran for Build: ${JSON.stringify(options)}`);

if (process.env['NX_MAVEN_CLI_OPTS']) {
if (options.mvnArgs) {
options.mvnArgs += ` ${process.env['NX_MAVEN_CLI_OPTS']}`;
} else {
options.mvnArgs = `${process.env['NX_MAVEN_CLI_OPTS']}`;
}
}

let command = getExecutable();

if (options.mvnArgs) {
Expand Down
4 changes: 0 additions & 4 deletions packages/maven/src/executors/test/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ export default async function runExecutor(
logger.info(`Executor ran for Test: ${JSON.stringify(options)}`);
let command = getExecutable();

if (process.env['NX_MAVEN_CLI_OPTS']) {
command += ` ${process.env['NX_MAVEN_CLI_OPTS']}`;
}

command += ` test -pl :${context.projectName}`;

if (options.mvnArgs) {
Expand Down
8 changes: 7 additions & 1 deletion packages/maven/src/lib/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ import { readXml } from '../xml';

export function getExecutable() {
const isWin = process.platform === 'win32';
return isWin ? 'mvnw.cmd' : './mvnw';
let executable = isWin ? 'mvnw.cmd' : './mvnw';

if (process.env['NX_MAVEN_CLI_OPTS']) {
executable += ` ${process.env['NX_MAVEN_CLI_OPTS']}`;
}

return executable;
}

export function isPomPackaging(context: ExecutorContext): boolean {
Expand Down

0 comments on commit 85a1f5d

Please sign in to comment.