OSS TanbouSign in with GitHub

build Java and Android dependency-injection graphs with compile-time code generation and no runtime reflection

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
17,702
Primary language
Java
License
Apache-2.0
Repository last updated
Oct 3, 2026
On this page

Overview

Dagger is a compile-time dependency-injection framework for Java and Android. Its annotation processor validates dependency graphs and generates plain Java source without runtime reflection or bytecode generation. The same repository also contains Hilt.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Key features

Declare graphs with @Inject, @Provides, @Binds, and @Component

Constructor injection and module bindings describe dependencies while components define graph entry points implemented at compile time.

Sources: [1]

Validate graphs and generate Java source at compile time

Dagger performs graph analysis during compilation and surfaces missing bindings or graph errors as build failures instead of runtime resolution failures.

Sources: [1]

Use Hilt for Android framework integration

The repository also publishes Hilt Android artifacts and plugin support for wiring dependency injection into Android framework components.

Sources: [1]

Best fit

Fits Java and Android applications that want type-safe dependency graphs fixed at build time

It is useful for large object graphs where teams want generated code and compile-time validation rather than reflective runtime containers.

Sources: [1]

Before adoption

Build tooling must run an annotation or symbol processor

The runtime artifact alone is insufficient. Maven needs dagger-compiler as an annotation processor, while Gradle/Kotlin builds need corresponding processing configuration.

Sources: [1][3]

Review the 2.60-line Hilt changes together with 2.60.1 fixes

The 2.60 line changed Hilt requirements and plugin behavior, while 2.60.1 fixes compiler-option propagation and an @CanIgnoreReturnValue import regression.

Sources: [2]

Official sources

  1. [1]Dagger 2.60.1 README(2026-10-04)
  2. [2]Dagger 2.60.1 release(2026-10-04)
  3. [3]Dagger 2.60.1 build versions(2026-10-04)
  4. [4]Dagger Apache 2.0 license(2026-10-04)
Supplemental curator note

Dagger generates implementations through annotation processing rather than runtime reflection. Hilt users should review the 2.60-line requirement/plugin changes and the regression fixes in 2.60.1.

Try it in 3 steps

  1. 1

    Create a minimal Maven project for Dagger 2.60.1

    Pin the Dagger runtime and annotation processor to 2.60.1 in an isolated Java 17 project.

    mkdir -p dagger-demo/src/main/java/demo && printf '%s\n' '<project xmlns="http://maven.apache.org/POM/4.0.0">' '<modelVersion>4.0.0</modelVersion>' '<groupId>demo</groupId><artifactId>dagger-demo</artifactId><version>1.0.0</version>' '<properties><maven.compiler.release>17</maven.compiler.release></properties>' '<dependencies><dependency><groupId>com.google.dagger</groupId><artifactId>dagger</artifactId><version>2.60.1</version></dependency></dependencies>' '<build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.13.0</version><configuration><annotationProcessorPaths><path><groupId>com.google.dagger</groupId><artifactId>dagger-compiler</artifactId><version>2.60.1</version></path></annotationProcessorPaths></configuration></plugin></plugins></build>' '</project>' > dagger-demo/pom.xml
  2. 2

    Define an @Inject class and @Component

    Create a minimal constructor-injection graph with one component entry point.

    printf '%s\n' 'package demo;' 'import javax.inject.Inject;' 'final class CoffeeMaker { @Inject CoffeeMaker() {} }' > dagger-demo/src/main/java/demo/CoffeeMaker.java && printf '%s\n' 'package demo;' 'import dagger.Component;' '@Component interface AppComponent { CoffeeMaker maker(); }' > dagger-demo/src/main/java/demo/AppComponent.java
  3. 3

    Compile and verify the generated component

    Run annotation processing and confirm that Dagger generates plain Java source.

    cd dagger-demo && mvn -q compile && test -f target/generated-sources/annotations/demo/DaggerAppComponent.java && echo 'Dagger generated source OK'
Check the official README

Growth

Growth trends · Last 30 days

17,702 Stars

Trend data is still being collected.

Development activity

Last 90 days · weekly

Commits (last 30 days)
29
Open PRs
105

Development activity is still being collected.

Built with

Categories and tags

Categories

GitHub data

GitHub dataView detailed GitHub data
Stars
17,702
Forks
2,045
Watchers
510
Open issues
265
Contributors
133
Owner type
Organization
Primary language
Java
License
Apache-2.0
Repository last updated
Oct 3, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?