From b635e1ed63d1cace76575ff4e5b63d47b68397db Mon Sep 17 00:00:00 2001 From: khalilou88 Date: Thu, 28 Dec 2023 13:25:22 +0100 Subject: [PATCH] feat(executors): add skipProject option --- packages/nx-maven/src/executors/run-task/executor.ts | 6 +++++- packages/nx-maven/src/executors/run-task/schema.d.ts | 3 ++- packages/nx-maven/src/executors/run-task/schema.json | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/nx-maven/src/executors/run-task/executor.ts b/packages/nx-maven/src/executors/run-task/executor.ts index 8fa9ddb8e..37897627c 100644 --- a/packages/nx-maven/src/executors/run-task/executor.ts +++ b/packages/nx-maven/src/executors/run-task/executor.ts @@ -18,7 +18,11 @@ export default async function runExecutor( task = options.task; } - const command = `${getExecutable()} ${task} -pl :${context.projectName}`; + let command = `${getExecutable()} ${task}`; + + if (!options.skipProject) { + command += ` -pl :${context.projectName}`; + } const mavenRootDirectory = getMavenRootDirectory(); const result = runCommand(command, join(workspaceRoot, mavenRootDirectory)); diff --git a/packages/nx-maven/src/executors/run-task/schema.d.ts b/packages/nx-maven/src/executors/run-task/schema.d.ts index 19a29b41b..7b835bd1f 100644 --- a/packages/nx-maven/src/executors/run-task/schema.d.ts +++ b/packages/nx-maven/src/executors/run-task/schema.d.ts @@ -1,5 +1,6 @@ export interface RunTaskExecutorSchema { task: string | string[]; - keepItRunning: boolean; + keepItRunning?: boolean; outputDirLocalRepo?: string; + skipProject?: boolean; } diff --git a/packages/nx-maven/src/executors/run-task/schema.json b/packages/nx-maven/src/executors/run-task/schema.json index 9aa0ffc21..7602e6868 100644 --- a/packages/nx-maven/src/executors/run-task/schema.json +++ b/packages/nx-maven/src/executors/run-task/schema.json @@ -26,6 +26,11 @@ "outputDirLocalRepo": { "type": "string", "description": "The artifacts created during the `install phase` will be placed in this sub-directory of the Maven local repository (dynamically calculated)" + }, + "skipProject": { + "type": "boolean", + "description": "Skip specifying a project by generating `-pl :project` part", + "default": false } }, "required": ["task"]