Enhancement: read the Java version from `maven-compiler-plugin` `<release>` / `<source>` configuration

未关闭 适合新手
#658 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@vibgrate-team 已经在做这个了。

开始于 2026年11月13日。

  • #679 来自 @vibgrate-team —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
java, typescript
领域
backend, cli

调研方向

从 src/core-open/scanners/java-scanner.ts 中的 parsePom 开始,阅读代码如何检查 POM 属性并调用 resolveProperty。为 build.plugins 和 build.pluginManagement.plugins 下编译器插件的 release、source 和 target 设置补充测试,包括属性引用。运行相关的 Java scanner 测试;当插件值能够被识别且 maven.compiler.release 属性仍然优先时,任务即告完成。

由索引模型根据 Issue 内容生成。

描述

enhancement

Context

parsePom in src/core-open/scanners/java-scanner.ts (around line 188) only looks for the Java version in <properties>: java.version, maven.compiler.source, maven.compiler.target, maven.compiler.release and java.source.version.

Plenty of POMs set it on the compiler plugin instead:

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <configuration>
        <release>17</release>
      </configuration>
    </plugin>
  </plugins>
</build>

Those projects get no Java runtime in vg scan, so runtime drift and EOL status are missing for them.

What to do

  1. When no property gave a version, look for maven-compiler-plugin under build.plugins.plugin and build.pluginManagement.plugins.plugin (one plugin or an array).
  2. Read configuration.release first, then configuration.source, then configuration.target.
  3. Run the value through resolveProperty so <release>${jdk.version}</release> works when the property exists.
  4. Add tests for each form, including a property reference.

Acceptance

  • A POM whose only Java version is <release>17</release> on maven-compiler-plugin reports Java 17
  • <source>11</source> is used when <release> is absent
  • A maven.compiler.release property still wins over plugin configuration
  • A property reference in the plugin configuration is resolved
主要语言
TypeScript
星标
4
派生
3
平均合并
1 天 22 小时
30 天内合并 PR
76

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

vibgrate/cli 的其他 Issue

查看 vibgrate/cli 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。