Skip to content

feat(maven): 模型报告 Settings File 与 Local Repository 的实际值 - #37

Merged
1lck merged 1 commit into
mainfrom
feat/report-effective-paths
Nov 19, 2026
Merged

1lck merged 1 commit into
mainfrom
feat/report-effective-paths

Conversation

@1lck

@1lck 1lck commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

关联 Issue

改动

IDEA 的 Maven 设置里,用户设置文件和本地仓库在没有覆盖时灰显 Maven 实际使用的路径(PathOverrider,取值规则见 MavenUtil.resolveUserSettingsPath / resolveLocalRepository)。Lithe 宿主已经支持(Lithe-core-rust#120、#121,1lck/Lithe-IDEA#2210):模型为文本、文件、目录选项报告的 optionDefaults 会作为 implicitValue 显示,并配有“覆盖”复选框。本 PR 让 Maven 扩展报告这两个值:

  • settingsFile:~/.m2/settings.xml,即 Maven 默认的用户设置文件。
  • localRepository:本次读取的设置(用户设置文件,然后是全局设置)中的 <localRepository>,没有时为 ~/.m2/repository。用户用 Settings File 覆盖了设置文件时,本地仓库跟随被覆盖的文件,与 IDEA 一致。
  • optionDefaults 现在总是输出;没有默认激活的 profile 时,不再包含 profiles 键。

清单没有变。旧 Core 只接受 choicesFromModel 选项的 optionDefaults,会静默丢弃这两项,所以兼容所有已发布的桌面版本。选项的 description 和中文名会让旧 Core 拒绝整个清单,要等包含 Core #120 的桌面版发布后再加。

验证

  • node scripts/package.mjs、node scripts/test.mjs(macOS arm64,本机 Maven):新增用例 the model reports the settings file and local repository Maven uses 通过;已有用例改为只断言 optionDefaults.profiles。共 35 项通过。
  • 剩下的一项 profiles become choices of the Profiles option 本机失败,是已有问题:主模型用例读取了本机 ~/.m2/settings.xml 中的 profile,与本改动无关,已提交 test: scripts/test.mjs 的主模型用例读取本机 ~/.m2/settings.xml,本机有 profile 时失败 #36。CI 机器上没有用户设置,不受影响。
  • docs/feature-matrix.md 的 java-maven-project-settings 补充了实际值说明。

🤖 Generated with Claude Code

扩展在 litheBuildModel 的 optionDefaults 中报告不传参数时 Maven 实际使用的
用户设置文件(~/.m2/settings.xml)和本地仓库(本次读取的设置中的
<localRepository>,没有时为 ~/.m2/repository),对应 IntelliJ IDEA Maven
设置里 PathOverrider 灰显的默认值。宿主据此显示“覆盖”复选框;旧宿主忽略
这两项,所以清单不变、兼容所有已发布的桌面版本。

Refs 1lck/Lithe-IDEA#2152

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@1lck
1lck marked this pull request as ready for review November 19, 2026 12:42
@1lck
1lck merged commit c7bb462 into main Nov 19, 2026
0 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant