Skip to content

Commit

Permalink
feat(executors): add skipProject option
Browse files Browse the repository at this point in the history
  • Loading branch information
khalilou88 committed Jan 2, 2024
1 parent f3fd5ec commit b635e1e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/nx-maven/src/executors/run-task/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
3 changes: 2 additions & 1 deletion packages/nx-maven/src/executors/run-task/schema.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export interface RunTaskExecutorSchema {
task: string | string[];
keepItRunning: boolean;
keepItRunning?: boolean;
outputDirLocalRepo?: string;
skipProject?: boolean;
}
5 changes: 5 additions & 0 deletions packages/nx-maven/src/executors/run-task/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit b635e1e

Please sign in to comment.