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 a02edffaf..7b835bd1f 100644 --- a/packages/nx-maven/src/executors/run-task/schema.d.ts +++ b/packages/nx-maven/src/executors/run-task/schema.d.ts @@ -2,4 +2,5 @@ export interface RunTaskExecutorSchema { task: string | string[]; 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"]