feat(java): Add Project JDK and Maven home / settings.xml / local repository settings

The JDK was always picked automatically (JAVA_HOME, PATH, the usual install dirs, by the
module's Java version) and Maven was the project's mvnw or mvn on PATH, with no way to
override either. languages.java.jdk (Languages & Frameworks › Java › Project JDK) now sets
the default jdtls runtime, the JDK of Run/Debug and JAVA_HOME for Maven and Gradle;
languages.java.maven (Build Tools › Maven) sets the Maven home, -s and
-Dmaven.repo.local for sync, builds, tool-window goals and detected run configurations.
JDKs and Maven installations are detected for the pickers.

Closes #13
Цей коміт міститься в:
l0ng-ai committed 2026-10-23 23:00:48 +08:00
1 джерело c59f93988b
коміт 7fa1d08b94
22 files changed
+484 -48

No files matched your search

+25 -1
Переглянути файл
@@ -249,6 +249,7 @@ export const commands = {
* follow-up command. Edits the server requests arrive via `workspace/applyEdit`.
*/
lspExecuteCommand: (doc: DocId, command: Command) => typedError<null, IdeError>(__TAURI_INVOKE("lsp_execute_command", { doc, command })),
/** Changes of every repository of the project. */
vcsStatus: () => typedError<FileStatus[], IdeError>(__TAURI_INVOKE("vcs_status")),
vcsBranchInfo: () => typedError<BranchInfo, IdeError>(__TAURI_INVOKE("vcs_branch_info")),
/** Gutter change markers for a file, computed against its current (unsaved) text. */
@@ -2341,11 +2342,18 @@ export type JavaLaunchInfo = {
};
export type JavaSettings = {
/**
* Project JDK home; empty = per module, the installed JDK matching the
* Java version it targets.
*/
jdk?: string,
/**
* Extra JVM options for the Java language server (jdtls), space-separated
* (VS Code's `java.jdt.ls.vmargs`).
*/
jdtlsVmArgs?: string,
/** Build Tools › Maven. */
maven?: MavenSettings,
};
/** Editor › Code Style › <Language> › Tabs and Indents (unset fields inherit). */
@@ -2635,10 +2643,22 @@ export type MavenProject = {
javaVersion: number | null,
/** Maven launcher: the nearest `mvnw` up to the project root (absolute), else `mvn`. */
command: string,
/** Options before the goals (`-s`, `-Dmaven.repo.local=`); filled in by the shell from settings. */
options: string[],
/** Environment for runs (`JAVA_HOME` of the matching JDK); filled in by the shell. */
env: { [key in string]: string },
};
/** Build Tools › Maven. */
export type MavenSettings = {
/** Maven home (or its `mvn` executable); empty = the project's `mvnw`, else `mvn` on `PATH`. */
home?: string,
/** User `settings.xml` (`-s`); empty = `~/.m2/settings.xml`. */
userSettings?: string,
/** Local repository (`-Dmaven.repo.local`); empty = from `settings.xml`. */
localRepository?: string,
};
export type MemoryCategory =
/** The backend and its WebView processes. */
"app" | "languageServer" |
@@ -3281,7 +3301,11 @@ export type Sdk = {
/** What [`detect`] looks for. */
export type SdkKind = "python" | "node" |
/** npm / pnpm / yarn executables. */
"packageManager" | "rust" | "go" | "typeScript";
"packageManager" | "rust" | "go" | "typeScript" |
/** JDK homes. */
"jdk" |
/** Maven homes. */
"maven";
export type SearchEvent = { type: "file"; file: FileMatches } | { type: "done"; summary: SearchSummary };