# square/javapoet

A Java API for generating .java source files.

Repository: https://github.com/square/javapoet
Canonical: https://ross.abutalabs.com/products/javapoet
Language: Java
License: Apache-2.0
License Family: permissive
Archived: true
Last push: 2024-10-10T21:04:58+00:00

## Health v2 (maintenance only)
Score: 10/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 4961, "days_push": 692, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, archived
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 10846, forks 1397 (observed 2026-08-28T04:10:44.484294+00:00)

## What it is
JavaPoet is a Java API for programmatically generating .java source files, useful for annotation processing and generating code from metadata like database schemas or protocol formats. It builds classes, methods, fields, and annotations via a fluent builder API and writes them as Java source code.

## Use cases
- generate java source files programmatically
- write an annotation processor that emits code
- generate boilerplate classes from a database schema
- generate model classes from a protocol definition
- avoid hand-writing repetitive java code

## When to choose
- you need to generate Java source code at build time or from metadata
- you are maintaining an existing project already using com.squareup:javapoet
- you want a simple builder API for emitting .java files

## When to avoid
- you need support for the latest Java language features - the project is deprecated as of 2020
- you are starting a new project - use Palantir's JavaPoet fork instead
- you need to model method bodies as syntax trees rather than format strings

## Facets
- artifact type: library
- maturity: abandoned
- function: developer-tools, parser
- domain: developer-tools, programming-languages
- platform: jvm, cross-platform
- tags: code-generation, java-source-generation, annotation-processing, deprecated, boilerplate-elimination, automation

## Member repositories
- square/javapoet (main) score 10

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:44.484294+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:17:30.180222+00:00, confidence not recorded.
  - readme: https://github.com/square/javapoet (fetched 2026-08-28T04:10:44.484294+00:00, sha 411fd88533cc)
- Data as of 2026-08-30T08:39:29.467469+00:00.
