AI觉醒星球
Awakening is here
Knowledge File / 全球热点解读
2026-07-09 6 浏览 公开

setup-java v5.5.0:签名验证、Kona JDK 和 Maven 修复

GitHub Actions 的 setup-java 发布 v5.5.0,新增 JDK 下载签名验证、支持腾讯 Kona JDK、默认不设置 JDK 选项及 Maven 构建日志优化等改进。

SOURCE / 全球热点解读 MIN / 4 ACCESS / 公开 POST / 2026-07-09 01:05:06

原贴

查看原文
作者:Allison 来源站点:github.blog 原贴时间:

原文

The actions/setup-java v5.5.0 release adds cryptographic signature verification for downloaded JDKs, support for a new distribution, and several quality-of-life improvements for Maven users. Here’s what changed since v5.4.0. Verify JDK download signatures: Set verify-signature: true and the action downloads the detached GPG signature and validates the JDK archive before installing it. Verification is supported today for the Temurin and Microsoft distributions, and enabling it for a distribution that doesn’t support it fails fast rather than silently skipping the check. You can supply your own trusted key with verify-signature-public-key . New Tencent Kona JDK distribution: The new kona distribution lets you install Tencent Kona JDK directly. Install a JDK without making it the default. With set-default: false , the action leaves JAVA_HOME and PATH untouched while still exporting JAVA_HOME__ and registering the JDK in Maven toolchains, so a single step can use a specific JDK without disturbing the rest of your workflow. Auto-detect the distribution from .sdkmanrc : When you drive your Java version from a .sdkmanrc file, the action now infers the distribution from the SDKMAN identifier suffix (e.g., -tem resolves to Temurin), so you no longer have to repeat it in the distribution input. Cleaner Maven build logs by default: The action now sets --no-transfer-progress in MAVEN_ARGS by default for Maven 3.9+ and the Maven Wrapper, giving you quieter logs out of the box. Any existing MAVEN_ARGS value is preserved, and you can restore the progress output with show-download-progress: true . The generated settings.xml also disables interactive mode so Maven never blocks a CI run waiting on a prompt. Fixed Maven toolchains no longer grow unexpectedly: Running the action multiple times in a job previously appended duplicate entries to toolchains.xml . The generated file is now deduplicated by toolchain type and id, and your existing root attributes and non-JDK toolchains are preserved. The v5.4.0 release shipped without a changelog post, so a few notable additions from that version are worth calling out too: The free GraalVM Community distribution ( graalvm-community ) A javac problem matcher that surfaces compiler errors and warnings as inline annotations on your pull requests Maven Wrapper caching when you enable cache: maven For reproducible, supply-chain-safe builds, pin the action to the exact v5.5.0 release tag or to its full commit SHA ( 0f481fcb613427c0f801b606911222b5b6f3083a ) for the strongest guarantee, rather than the floating v5 major tag.

中文翻译

actions/setup-java v5.5.0 版本为下载的 JDK 增加了加密签名验证,支持一个新的发行版,并为 Maven 用户带来了一些生活质量改进。以下是自 v5.4.0 以来的变化。

验证 JDK 下载签名:设置 verify-signature: true,该操作会在安装前下载分离的 GPG 签名并验证 JDK 归档。目前支持 Temurin 和 Microsoft 发行版的验证,如果为不支持的发行版启用该功能,会快速失败而不是静默跳过检查。您可以通过 verify-signature-public-key 提供自己的信任密钥。

新的腾讯 Kona JDK 发行版:新的 kona 发行版让您可以直接安装腾讯 Kona JDK。

安装 JDK 但不设为默认:使用 set-default: false,该操作会保持 JAVA_HOME 和 PATH 不变,同时仍导出 JAVA_HOME__ 并在 Maven toolchains 中注册 JDK,这样单个步骤可以使用特定 JDK 而不干扰工作流的其余部分。

从 .sdkmanrc 自动检测发行版:当您通过 .sdkmanrc 文件管理 Java 版本时,该操作现在会根据 SDKMAN 标识符后缀推断发行版(例如 -tem 解析为 Temurin),因此您无需在 distribution 输入中重复指定。

默认更简洁的 Maven 构建日志:该操作现在默认在 Maven 3.9+ 和 Maven Wrapper 的 MAVEN_ARGS 中设置 --no-transfer-progress,从而开箱即用地提供更安静的日志。任何现有的 MAVEN_ARGS 值都会被保留,您可以通过 show-download-progress: true 恢复进度输出。生成的 settings.xml 还禁用了交互模式,使 Maven 永远不会在等待提示时阻塞 CI 运行。

修复 Maven toolchains 不再意外增长:之前在一个作业中多次运行该操作会向 toolchains.xml 附加重复条目。现在生成的文件会按 toolchain 类型和 id 去重,并保留您现有的根属性及非 JDK toolchains。

v5.4.0 版本发布时没有附带更新日志,因此该版本中一些值得注意的补充也值得提及:免费的 GraalVM Community 发行版(graalvm-community)、一个 javac 问题匹配器(可在拉取请求上将编译错误和警告显示为内联注释)、启用 cache: maven 时的 Maven Wrapper 缓存。为了实现可重现的、供应链安全的构建,请将操作固定到确切的 v5.5.0 版本标签或其完整提交 SHA(0f481fcb613427c0f801b606911222b5b6f3083a)以获得最强保证,而不是使用浮动的 v5 主版本标签。

核心信息

GitHub Actions 的 setup-java 发布 v5.5.0,新增 JDK 下载签名验证、支持腾讯 Kona JDK、默认不设置 JDK 选项及 Maven 构建日志优化等改进。

  • GitHub Actions 的 setup-java 发布 v5.5.0,新增 JDK 下载签名验证、支持腾讯 Kona JDK、默认不设置 JDK 选项及 Maven 构建日志优化等改进。
  • 原贴提到:The actions/setup-java v5.5.0 release adds cryptographic signature verif
  • 来源:github.blog

详细解读

这是什么信号?setup-java v5.5.0 的发布标志着 GitHub Actions 生态中 Java 持续集成工具链的成熟。新增的签名验证功能直接回应了软件供应链安全威胁,而 Kona JDK 支持则反映了中国云厂商(腾讯云)在开源工具中的日益参与。Maven 相关的改进表明团队致力于提升开发者日常构建体验的易用性。

为什么重要?签名验证能有效防止 JDK 文件在下载过程中被篡改,尤其对于企业级 CI/CD 流水线,这是安全合规的基础。支持腾讯 Kona JDK 为国内用户或特定云环境提供原生选项,降低了配置成本。默认不设置 JDK 的选项(set-default: false)解决了多版本 JDK 并发使用的痛点,避免全局变量污染。Maven 日志精简和 toolchains 去重则直接减少了构建噪音和潜在错误。

对谁有价值?所有使用 GitHub Actions 进行 Java 项目构建的开发者或 DevOps 团队都能受益。特别对关注供应链安全的企业、多 JDK 版本管理的团队、以及使用腾讯云或 Kona JDK 的用户来说,价值更突出。Maven 用户会立即感受到日志更整洁。

可以怎么行动?立即在现有 workflow 中将 setup-java 更新到 v5.5.0(或固定 SHA),并考虑为 Temurin 或 Microsoft 发行版启用 verify-signature: true。若使用多 JDK,利用 set-default: false 管理特定步骤的 JDK 版本。查看 .sdkmanrc 文件中的 SDKMAN 标识符后缀,简化 distribution 配置。对于 GraalVM 或 Maven Wrapper 缓存需求,可一并启用。

风险或限制签名验证目前仅支持 Temurin 和 Microsoft,其他发行版开启会快速失败,需注意兼容性。set-default: false 的行为可能导致某些依赖 JAVA_HOME 的步骤行为异常,需测试。Maven 日志静默可能掩盖关键下载错误,建议配合 show-download-progress 按需开启。不建议在关键生产流水线立即全面启用,应先在测试 workflow 中验证。

信息差价值

这条内容的真正价值,不只是“有人发布了一个新功能”,而是它揭示了 github.blog 背后的产品方向、工作流变化或竞争信号。对 OPC 来说,这种信息可以转化成持续追踪的栏目选题。

如果把《setup-java v5.5.0:签名验证、Kona JDK 和 Maven 修复》放到你的内容系统里,它最大的价值在于帮助读者更快看懂“为什么值得关注”,而不是只看到一条碎片化动态。

参考来源

上一篇 GitHub 可用性报告:2026 年 6 月 下一篇 npm 安装时安全性和 GAT 绕过2FA 弃用