@nx/maven 22.7.8 → 22.7.9

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.
@@ -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":"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,CA2J5B"}
@@ -5,9 +5,9 @@ exports.runMavenAnalysis = runMavenAnalysis;
5
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
9
  const devkit_internals_1 = require("nx/src/devkit-internals");
10
+ const internal_1 = require("@nx/devkit/internal");
11
11
  const cache_directory_1 = require("nx/src/utils/cache-directory");
12
12
  const detect_maven_executable_1 = require("../utils/detect-maven-executable");
13
13
  const tree_kill_1 = tslib_1.__importDefault(require("tree-kill"));
@@ -78,10 +78,8 @@ 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
85
  // Use tree-kill on abort to kill the entire process tree
@@ -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": "22.7.8",
3
+ "version": "22.7.9",
4
4
  "private": false,
5
5
  "description": "Nx plugin for Maven integration",
6
6
  "repository": {
@@ -47,7 +47,7 @@
47
47
  "author": "Victor Savkin",
48
48
  "license": "MIT",
49
49
  "dependencies": {
50
- "@nx/devkit": "22.7.8",
50
+ "@nx/devkit": "22.7.9",
51
51
  "@xmldom/xmldom": "^0.8.10",
52
52
  "tree-kill": "^1.2.2",
53
53
  "tslib": "^2.3.0"
@@ -58,7 +58,7 @@
58
58
  "@types/xmldom": "^0.1.34",
59
59
  "jest": "30.3.0",
60
60
  "memfs": "^4.9.2",
61
- "nx": "22.7.8",
61
+ "nx": "22.7.9",
62
62
  "ts-jest": "^29.4.0",
63
63
  "typescript": "~5.9.2"
64
64
  },