Automic VaultAutomic Vault

brew

使用 Homebrew, MacPorts, Nix, scoop 安装 google-java-format

查看 google-java-format 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

安装

其他安装命令

macOS

Homebrew已验证 · 100%
brew install google-java-format

local Homebrew formula metadata

MacPorts已验证 · 94%
sudo port install google-java-format

MacPorts ports tree · java/google-java-format/Portfile · 来源: api.github.com

Linux

Nix已验证 · 92%
nix profile install nixpkgs#google-java-format

nixpkgs package indexes · pkgs/by-name/go/google-java-format/package.nix · 来源: api.github.com

Windows

Scoop已验证 · 92%
scoop install extras/google-java-format

Scoop official bucket manifest trees · bucket/google-java-format.json · 来源: api.github.com

概览

软件包摘要

Reformats Java source code to comply with Google Java Style

命令和别名

  • google-java-format
  • google-java-format-diff

历史

项目历史与用法

google-java-format is Google's command-line and library implementation of the Google Java Style formatter. The project deliberately avoids user-configurable formatting rules so Java code can be normalized to one Google style across editors, builds, and scripts.

项目历史

Google opened the GitHub repository in May 2015 and published a 0.1 Alpha release in November 2015. The 1.0 release followed in April 2016, establishing the formatter as a packaged tool rather than only an internal style convention.

The README describes several integration surfaces around the same formatter engine: a command-line jar or native binary, a diff-oriented helper script, JetBrains and Eclipse plugins, and use as a Java library from Maven or Gradle builds. That shape made the project useful both for individual developer machines and for automated formatting checks.

采用历史

Adoption grew through the Java tooling ecosystem because the formatter is intentionally prescriptive. The official README lists third-party integrations for Visual Studio Code, Gradle, Maven, SBT, and GitHub Actions, showing how package maintainers and build-tool authors wrapped the same formatter for their own workflows.

Package-manager adoption followed the CLI packaging model: Homebrew, MacPorts, Nix, and Scoop package the formatter so users can run `google-java-format` or `google-java-format-diff` without hand-managing the release jar.

使用方式

The common package-manager use is formatting whole Java files from the shell, rewriting files in place with `--replace`, checking changed lines with the diff helper, or enforcing style in CI with a nonzero exit when files differ. The library mode supports code generators and build tools that need formatted Java output.

The formatter depends on javac internals through the `jdk.compiler` module, so editor and library integrations document extra JVM export flags on strongly encapsulated JDKs.

为什么软件包爱好者会关心

google-java-format matters to package nerds because it packages a style guide as executable policy. It is a canonical example of a formatter with almost no bikeshed surface: installation, editor integration, and CI wiring matter more than local configuration.

It also sits at the intersection of Java release engineering and package distribution: jars, native binaries, IDE plugins, Maven artifacts, and OS package-manager formulae all expose the same opinionated formatting behavior.

时间线

  • 2015: GitHub repository created under google/google-java-format.
  • 2015: 0.1 Alpha published on GitHub Releases.
  • 2016: 1.0 release published on GitHub Releases.
  • 2017: 1.x releases added a steady release cadence for package managers and editor integrations.
  • 2021: JDK strong encapsulation made the documented `--add-exports` flags important for plugin and library users.

Related projects

  • The README points to Google Java Style, the IntelliJ and Eclipse plugins, google-java-format-diff, Spotless Gradle and Maven integrations, fmt-maven-plugin, sbt-java-formatter, and GitHub Actions wrappers.

安全态势

风险级别:绿色

narrow executable package without higher-risk signals.

风险分类器

绿色 风险 · 低 置信度 · appliance

原因

  • narrow executable package without higher-risk signals

信号

  • metadata:no-higher-risk-signals

安装行为

  • formula 元数据中未记录 Homebrew post-install 钩子。
  • Homebrew bottle 元数据适用于 1 个平台目标。
  • 安装时包含 1 个运行时依赖。

建议审查

在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。

可执行文件

已安装的可执行文件

命令类型暴露范围备注
google-java-formatcli全局可执行文件
google-java-format-diffcli全局可执行文件

新鲜度

版本和新鲜度

这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。

页面生成时间2026-07-10
管理器版本1.35.0
管理器更新时间
本地数据OK
上游not checked
检测到的最新版本未检测到

https://github.com/google/google-java-format

安装元数据

软件包元数据

软件包键brew:google-java-format
版本1.35.0
软件包管理器Homebrew
软件包管理器页面https://formulae.brew.sh/formula/google-java-format
主页https://github.com/google/google-java-format
仓库https://github.com/google/google-java-format
上游文档https://github.com/google/google-java-format#readme
许可证Apache-2.0
源码归档https://github.com/google/google-java-format/releases/download/v1.35.0/google-java-format-1.35.0-all-deps.jar
依赖openjdk
macOS 提供的库python
Bottle可用 (于 all)
Homebrew post-install未定义
服务未声明

注册表事实

源数据库详情

Source DatabaseHomebrew formula API
Taphomebrew/core
Full Namegoogle-java-format
Version Scheme0
Revision0
Bottle Stable Root URLhttps://ghcr.io/v2/homebrew/core
Deprecatedno
Disabledno
Keg Onlyno
URL Keys
  • stable

源数据库匹配

其他软件包管理器记录

匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。

Nix95%

google-java-format

nix profile install nixpkgs#google-java-format
  • normalized package name match
  • 匹配方式:Google Java Format
nixpkgs package indexes · api.github.com · nixpkgs package indexes: pkgs/by-name/go/google-java-format/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
MacPorts95%

google-java-format

sudo port install google-java-format
  • normalized package name match
  • 匹配方式:Google Java Format
MacPorts ports tree · api.github.com · MacPorts ports tree: java/google-java-format/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
Scoop95%

extras/google-java-format

scoop install extras/google-java-format
  • normalized package name match
  • 匹配方式:Google Java Format
Scoop official bucket manifest trees · api.github.com · Scoop official bucket manifest trees: bucket/google-java-format.json from https://api.github.com/repos/ScoopInstaller/Extras/git/trees/master?recursive=1

来源线索

由仓库数据生成

此页面由 av-webscripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。

使用的来源

  • Geiger risk classifier
  • Nucleus package database
  • av.db category and tag curation
  • cross-ecosystem install command graph
  • curated package history
  • external package-manager database matches
  • package relationship graph
  • package version freshness
  • package-page enrichment