@nx/maven 23.2.0-beta.1 → 23.2.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,9 +7,9 @@
7
7
 
8
8
  <div style="text-align: center;">
9
9
 
10
- [![License](https://img.shields.io/npm/l/@nx/workspace.svg?style=flat-square)]()
10
+ [![License](https://img.shields.io/npm/l/@nx/workspace.svg?style=flat-square)](<>)
11
11
  [![NPM Version](https://badge.fury.io/js/nx.svg)](https://www.npmjs.com/package/nx)
12
- [![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)]()
12
+ [![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](<>)
13
13
  [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
14
14
  [![Join us on the Official Nx Discord Server](https://img.shields.io/discord/1143497901675401286?label=discord)](https://go.nx.dev/community)
15
15
  [![Nx Sandboxing](https://staging.nx.app/workspaces/62d013ea0852fe0a2df74438/sandbox-badge.svg)](https://nx.dev/docs/features/ci-features/sandboxing)
Binary file
@@ -1,7 +1,6 @@
1
1
  import { ExecutorContext, TaskGraph } from '@nx/devkit';
2
- import { TaskResult } from 'nx/src/config/misc-interfaces';
3
- import { RunCommandsOptions } from 'nx/src/executors/run-commands/run-commands.impl';
4
2
  import { MavenExecutorSchema } from './schema';
3
+ import { TaskResult, RunCommandsOptions } from '@nx/devkit/internal';
5
4
  /**
6
5
  * Maven batch executor using Kotlin batch runner with Maven Invoker API.
7
6
  * Streams task results as they complete via async generator.
@@ -1 +1 @@
1
- {"version":3,"file":"maven-batch.impl.d.ts","sourceRoot":"","sources":["../../../src/executors/maven/maven-batch.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAiB,MAAM,YAAY,CAAC;AAKvE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAyE/C;;;GAGG;AACH,wBAA+B,kBAAkB,CAC/C,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,EAC3C,SAAS,EAAE,kBAAkB,EAC7B,OAAO,EAAE,eAAe,GACvB,cAAc,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,CAAC,CAmItD"}
1
+ {"version":3,"file":"maven-batch.impl.d.ts","sourceRoot":"","sources":["../../../src/executors/maven/maven-batch.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAiB,MAAM,YAAY,CAAC;AAKvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAyErE;;;GAGG;AACH,wBAA+B,kBAAkB,CAC/C,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,EAC3C,SAAS,EAAE,kBAAkB,EAC7B,OAAO,EAAE,eAAe,GACvB,cAAc,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,CAAC,CAmItD"}
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = mavenExecutor;
4
- const tslib_1 = require("tslib");
5
4
  const devkit_1 = require("@nx/devkit");
6
- const run_commands_impl_1 = tslib_1.__importDefault(require("nx/src/executors/run-commands/run-commands.impl"));
5
+ const internal_1 = require("@nx/devkit/internal");
7
6
  const detect_maven_executable_1 = require("../../utils/detect-maven-executable");
8
7
  const nxMavenApplyGoal = 'dev.nx.maven:nx-maven-plugin:apply';
9
8
  const nxMavenRecordGoal = 'dev.nx.maven:nx-maven-plugin:record';
@@ -60,7 +59,7 @@ async function mavenExecutor(options, context) {
60
59
  const mavenProject = getMavenProjectName(context);
61
60
  const useMaven4 = (0, detect_maven_executable_1.isMaven4)(devkit_1.workspaceRoot);
62
61
  const args = buildMavenArgs(options, mavenProject, useMaven4);
63
- return (0, run_commands_impl_1.default)({
62
+ return (0, internal_1.runCommandsExecutor)({
64
63
  command: mavenExecutable,
65
64
  cwd: devkit_1.workspaceRoot,
66
65
  args,
@@ -1 +1 @@
1
- {"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../src/generators/ci-workflow/generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,IAAI,EACL,MAAM,YAAY,CAAC;AA4CpB,MAAM,MAAM,OAAO,GAAG;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC1B,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACtB;AAED,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,iBAMnE;eAsCc,mBAAmB"}
1
+ {"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../src/generators/ci-workflow/generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,IAAI,EACL,MAAM,YAAY,CAAC;AA+CpB,MAAM,MAAM,OAAO,GAAG;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC1B,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACtB;AAED,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,iBAMnE;eAsCc,mBAAmB"}
@@ -3,8 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ciWorkflowGenerator = ciWorkflowGenerator;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const path_1 = require("path");
6
- const nx_cloud_utils_1 = require("nx/src/utils/nx-cloud-utils");
7
- const default_base_1 = require("nx/src/utils/default-base");
6
+ const internal_1 = require("@nx/devkit/internal");
8
7
  function getCiCommands(ci) {
9
8
  switch (ci) {
10
9
  case 'circleci': {
@@ -52,13 +51,13 @@ function getTemplateData(tree, options) {
52
51
  const { name: workflowName, fileName: workflowFileName } = (0, devkit_1.names)(options.name);
53
52
  let nxCloudHost = 'nx.app';
54
53
  try {
55
- const nxCloudUrl = (0, nx_cloud_utils_1.getNxCloudUrl)((0, devkit_1.readNxJson)(tree));
54
+ const nxCloudUrl = (0, internal_1.getNxCloudUrl)((0, devkit_1.readNxJson)(tree));
56
55
  nxCloudHost = new URL(nxCloudUrl).host;
57
56
  }
58
57
  catch { }
59
- const mainBranch = (0, default_base_1.deduceDefaultBase)();
58
+ const mainBranch = (0, internal_1.deduceDefaultBase)();
60
59
  const commands = options.commands ?? getCiCommands(options.ci);
61
- const connectedToCloud = (0, nx_cloud_utils_1.isNxCloudUsed)((0, devkit_1.readNxJson)(tree));
60
+ const connectedToCloud = (0, internal_1.isNxCloudUsed)((0, devkit_1.readNxJson)(tree));
62
61
  return {
63
62
  workflowName,
64
63
  workflowFileName,
Binary file
@@ -4,6 +4,7 @@ import { MavenAnalysisData, MavenPluginOptions } from './types';
4
4
  * Safe to call even if nothing is running.
5
5
  */
6
6
  export declare function cancelPendingMavenAnalysis(): void;
7
+ export declare function getAnalysisTimeoutMs(): number;
7
8
  /**
8
9
  * Run Maven analysis using our Kotlin analyzer plugin
9
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"maven-analyzer.d.ts","sourceRoot":"","sources":["../../src/plugins/maven-analyzer.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAQhE;;;GAGG;AACH,wBAAgB,0BAA0B,IAAI,IAAI,CAKjD;AAaD;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,iBAAiB,CAAC,CA6J5B"}
1
+ {"version":3,"file":"maven-analyzer.d.ts","sourceRoot":"","sources":["../../src/plugins/maven-analyzer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAiBhE;;;GAGG;AACH,wBAAgB,0BAA0B,IAAI,IAAI,CAKjD;AAED,wBAAgB,oBAAoB,IAAI,MAAM,CAS7C;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,iBAAiB,CAAC,CAgK5B"}
@@ -1,17 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.cancelPendingMavenAnalysis = cancelPendingMavenAnalysis;
4
+ exports.getAnalysisTimeoutMs = getAnalysisTimeoutMs;
4
5
  exports.runMavenAnalysis = runMavenAnalysis;
5
- const tslib_1 = require("tslib");
6
6
  const path_1 = require("path");
7
7
  const fs_1 = require("fs");
8
- const child_process_1 = require("child_process");
9
8
  const devkit_1 = require("@nx/devkit");
10
- const devkit_internals_1 = require("nx/src/devkit-internals");
11
- const cache_directory_1 = require("nx/src/utils/cache-directory");
12
9
  const detect_maven_executable_1 = require("../utils/detect-maven-executable");
13
- const tree_kill_1 = tslib_1.__importDefault(require("tree-kill"));
14
- const DEFAULT_ANALYSIS_TIMEOUT_SECONDS = (0, devkit_internals_1.isCI)() ? 600 : 120;
10
+ const internal_1 = require("@nx/devkit/internal");
11
+ const DEFAULT_ANALYSIS_TIMEOUT_SECONDS = (0, internal_1.isCI)() ? 600 : 120;
12
+ // setTimeout silently clamps a delay past the 32-bit signed max to 1ms, which
13
+ // would abort immediately — the opposite of what a large value asks for.
14
+ const MAX_TIMEOUT_MS = 2 ** 31 - 1;
15
15
  let currentAbortController;
16
16
  /**
17
17
  * Cancel any in-flight Maven analysis process.
@@ -28,7 +28,7 @@ function getAnalysisTimeoutMs() {
28
28
  if (envTimeout) {
29
29
  const parsed = Number(envTimeout);
30
30
  if (!Number.isNaN(parsed) && parsed > 0) {
31
- return parsed * 1000;
31
+ return Math.min(parsed * 1000, MAX_TIMEOUT_MS);
32
32
  }
33
33
  }
34
34
  return DEFAULT_ANALYSIS_TIMEOUT_SECONDS * 1000;
@@ -37,13 +37,13 @@ function getAnalysisTimeoutMs() {
37
37
  * Run Maven analysis using our Kotlin analyzer plugin
38
38
  */
39
39
  async function runMavenAnalysis(workspaceRoot, options) {
40
- const outputFile = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, 'nx-maven-projects.json');
40
+ const outputFile = (0, path_1.join)(internal_1.workspaceDataDirectory, 'nx-maven-projects.json');
41
41
  const isVerbose = options.verbose || process.env.NX_VERBOSE_LOGGING === 'true';
42
42
  devkit_1.logger.verbose(`[Maven Analyzer] Starting analysis with options: ${JSON.stringify(options)}`);
43
43
  devkit_1.logger.verbose(`[Maven Analyzer] Output file: ${outputFile}`);
44
44
  devkit_1.logger.verbose(`[Maven Analyzer] Verbose mode: ${isVerbose}`);
45
45
  devkit_1.logger.verbose(`[Maven Analyzer] Workspace root: ${workspaceRoot}`);
46
- devkit_1.logger.verbose(`[Maven Analyzer] Workspace data directory: ${cache_directory_1.workspaceDataDirectory}`);
46
+ devkit_1.logger.verbose(`[Maven Analyzer] Workspace data directory: ${internal_1.workspaceDataDirectory}`);
47
47
  // Detect Maven executable (mvnd > mvnw > mvn)
48
48
  const mavenExecutable = (0, detect_maven_executable_1.detectMavenExecutable)(workspaceRoot);
49
49
  const mavenArgs = [
@@ -78,17 +78,20 @@ async function runMavenAnalysis(workspaceRoot, options) {
78
78
  devkit_1.logger.verbose(`[Maven Analyzer] Spawning Maven process...`);
79
79
  try {
80
80
  await new Promise((resolve, reject) => {
81
- const child = (0, child_process_1.spawn)(mavenExecutable, mavenArgs, {
81
+ const child = (0, internal_1.safeSpawn)(mavenExecutable, mavenArgs, {
82
82
  cwd: workspaceRoot,
83
- windowsHide: true,
84
- shell: true,
85
83
  stdio: 'pipe', // Always use pipe so we can control output
86
84
  });
87
- // Use tree-kill on abort to kill the entire process tree
85
+ // A plugin worker torn down by `nx reset` would otherwise orphan the build.
86
+ (0, internal_1.killChildOnHostExit)(child);
87
+ // On abort, kill the entire process tree and settle immediately — a
88
+ // wedged process that outlives the kill signal would otherwise keep
89
+ // this promise pending and the abort error would never surface.
88
90
  const onAbort = () => {
89
91
  if (child.pid) {
90
- (0, tree_kill_1.default)(child.pid);
92
+ (0, internal_1.killProcessTreeGraceful)(child.pid).catch(() => { });
91
93
  }
94
+ reject(new Error('Maven analysis aborted'));
92
95
  };
93
96
  signal.addEventListener('abort', onAbort, { once: true });
94
97
  devkit_1.logger.verbose(`[Maven Analyzer] Process spawned with PID: ${child.pid}`);
@@ -1,5 +1,5 @@
1
- import { PluginCache } from 'nx/src/utils/plugin-cache-utils';
2
1
  import { MavenAnalysisData } from './types';
2
+ import { PluginCache } from '@nx/devkit/internal';
3
3
  /**
4
4
  * Read the Maven targets cache from disk
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"maven-data-cache.d.ts","sourceRoot":"","sources":["../../src/plugins/maven-data-cache.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C;;GAEG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,GAChB,WAAW,CAAC,iBAAiB,CAAC,CAEhC;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,WAAW,CAAC,iBAAiB,CAAC,GACpC,IAAI,CAEN;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,GAClB,MAAM,CAOR;AAQD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAEjE;AAED,wBAAgB,mBAAmB,IAAI,iBAAiB,GAAG,IAAI,CAE9D"}
1
+ {"version":3,"file":"maven-data-cache.d.ts","sourceRoot":"","sources":["../../src/plugins/maven-data-cache.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD;;GAEG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,GAChB,WAAW,CAAC,iBAAiB,CAAC,CAEhC;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,WAAW,CAAC,iBAAiB,CAAC,GACpC,IAAI,CAEN;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,GAClB,MAAM,CAOR;AAQD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAEjE;AAED,wBAAgB,mBAAmB,IAAI,iBAAiB,GAAG,IAAI,CAE9D"}
@@ -6,12 +6,12 @@ exports.getCachePath = getCachePath;
6
6
  exports.setCurrentMavenData = setCurrentMavenData;
7
7
  exports.getCurrentMavenData = getCurrentMavenData;
8
8
  const path_1 = require("path");
9
- const plugin_cache_utils_1 = require("nx/src/utils/plugin-cache-utils");
9
+ const internal_1 = require("@nx/devkit/internal");
10
10
  /**
11
11
  * Read the Maven targets cache from disk
12
12
  */
13
13
  function readMavenCache(cachePath) {
14
- return new plugin_cache_utils_1.PluginCache(cachePath);
14
+ return new internal_1.PluginCache(cachePath);
15
15
  }
16
16
  /**
17
17
  * Write the Maven targets cache to disk
@@ -1 +1 @@
1
- {"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../src/plugins/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,WAAW,EAAa,MAAM,YAAY,CAAC;AAG5E,OAAO,EAAmB,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAU9D;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,kBAAkB,CA+EvD,CAAC"}
1
+ {"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../src/plugins/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,WAAW,EAAa,MAAM,YAAY,CAAC;AAG5E,OAAO,EAAmB,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAS9D;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,kBAAkB,CA+EvD,CAAC"}
@@ -7,7 +7,6 @@ const path_1 = require("path");
7
7
  const types_1 = require("./types");
8
8
  const maven_analyzer_1 = require("./maven-analyzer");
9
9
  const maven_data_cache_1 = require("./maven-data-cache");
10
- const devkit_internals_1 = require("nx/src/devkit-internals");
11
10
  /**
12
11
  * Maven plugin that analyzes Maven projects and returns configurations
13
12
  */
@@ -29,7 +28,7 @@ exports.createNodes = [
29
28
  return [];
30
29
  }
31
30
  // Get cache path based on options
32
- const optionsHash = (0, devkit_internals_1.hashObject)(opts);
31
+ const optionsHash = (0, internal_1.hashObject)(opts);
33
32
  const cachePath = (0, maven_data_cache_1.getCachePath)(context.workspaceRoot, optionsHash);
34
33
  const mavenCache = (0, maven_data_cache_1.readMavenCache)(cachePath);
35
34
  // Calculate hashes for all pom.xml directories
@@ -1,5 +1,5 @@
1
1
  import type { CreateNodesResultArray } from '@nx/devkit';
2
- import type { RawProjectGraphDependency } from 'nx/src/project-graph/project-graph-builder';
2
+ import { type RawProjectGraphDependency } from '@nx/devkit';
3
3
  export interface MavenPluginOptions {
4
4
  verbose?: boolean;
5
5
  targetNamePrefix?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugins/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AAE5F,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,eAAe,EAAE,kBAAuB,CAAC;AAKtD,MAAM,WAAW,iBAAiB;IAChC,kBAAkB,EAAE,sBAAsB,CAAC;IAC3C,yBAAyB,EAAE,yBAAyB,EAAE,CAAC;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugins/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE5D,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,eAAe,EAAE,kBAAuB,CAAC;AAKtD,MAAM,WAAW,iBAAiB;IAChC,kBAAkB,EAAE,sBAAsB,CAAC;IAC3C,yBAAyB,EAAE,yBAAyB,EAAE,CAAC;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"detect-maven-executable.d.ts","sourceRoot":"","sources":["../../src/utils/detect-maven-executable.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAwBvE;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAGvD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CA4BnE"}
1
+ {"version":3,"file":"detect-maven-executable.d.ts","sourceRoot":"","sources":["../../src/utils/detect-maven-executable.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAqBvE;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAGvD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CA4BnE"}
@@ -4,10 +4,9 @@ exports.detectMavenVersion = detectMavenVersion;
4
4
  exports.isMaven4 = isMaven4;
5
5
  exports.detectMavenExecutable = detectMavenExecutable;
6
6
  const fs_1 = require("fs");
7
- const child_process_1 = require("child_process");
8
7
  const path_1 = require("path");
9
8
  const devkit_1 = require("@nx/devkit");
10
- // Cache Maven version to avoid repeated execSync calls
9
+ const internal_1 = require("@nx/devkit/internal");
11
10
  let cachedMavenVersion = null;
12
11
  /**
13
12
  * Detect Maven version (e.g., "4.0.0-rc-4" or "3.9.9")
@@ -18,11 +17,8 @@ function detectMavenVersion(workspaceRoot) {
18
17
  }
19
18
  const executable = detectMavenExecutable(workspaceRoot);
20
19
  try {
21
- const output = (0, child_process_1.execSync)(`${executable} --version`, {
20
+ const output = (0, internal_1.safeExecFileSync)(executable, ['--version'], {
22
21
  cwd: workspaceRoot,
23
- stdio: 'pipe',
24
- encoding: 'utf-8',
25
- windowsHide: true,
26
22
  });
27
23
  // Parse version from output like "Apache Maven 4.0.0-rc-4" or "Apache Maven 3.9.9"
28
24
  const match = output.match(/Apache Maven (\d+\.\d+\.\d+[^\s]*)/);
@@ -50,7 +46,7 @@ function isMaven4(workspaceRoot) {
50
46
  function detectMavenExecutable(workspaceRoot) {
51
47
  // First priority: Check for Maven Daemon
52
48
  try {
53
- (0, child_process_1.execSync)('mvnd --version', { stdio: 'pipe', windowsHide: true });
49
+ (0, internal_1.safeExecFileSync)('mvnd', ['--version']);
54
50
  devkit_1.logger.verbose(`[Maven] Found Maven Daemon, using: mvnd`);
55
51
  return 'mvnd';
56
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/maven",
3
- "version": "23.2.0-beta.1",
3
+ "version": "23.2.0-beta.11",
4
4
  "private": false,
5
5
  "description": "Nx plugin for Maven integration",
6
6
  "repository": {
@@ -50,9 +50,8 @@
50
50
  "license": "MIT",
51
51
  "dependencies": {
52
52
  "@xmldom/xmldom": "^0.8.10",
53
- "tree-kill": "^1.2.2",
54
53
  "tslib": "^2.3.0",
55
- "@nx/devkit": "23.2.0-beta.1"
54
+ "@nx/devkit": "23.2.0-beta.11"
56
55
  },
57
56
  "devDependencies": {
58
57
  "@types/jest": "30.0.0",
@@ -62,7 +61,7 @@
62
61
  "memfs": "^4.9.2",
63
62
  "ts-jest": "^29.4.7",
64
63
  "typescript": "~6.0.3",
65
- "nx": "23.2.0-beta.1"
64
+ "nx": "23.2.0-beta.11"
66
65
  },
67
66
  "publishConfig": {
68
67
  "access": "public"