Honor selected JDK during Maven detection

This commit is contained in:
王鹏
2026-10-09 12:23:10 +08:00
parent 2f3d275021
commit d524d160f6
4 changed files with 117 additions and 11 deletions

View File

@@ -15,7 +15,7 @@ from datetime import datetime
from pathlib import Path
from typing import Callable, Iterable, Mapping
from .environment import discover_executable
from .environment import discover_executable, resolve_tool_path
from .scanner import ScanResult
@@ -249,8 +249,8 @@ def build_deployment_plan(scan: ScanResult, config: DeploymentConfig) -> list[De
def _tool_command(config: DeploymentConfig, tool_name: str, fallback: str) -> str:
configured = config.tool_paths.get(tool_name) if config.tool_paths else None
if configured:
path = Path(configured)
if path.exists():
path = resolve_tool_path(tool_name, configured)
if path:
return str(path)
discovered = discover_executable(tool_name, config.tool_search_roots)