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.
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]Dagger 2.60.1 README(2026-10-04)
- [2]Dagger 2.60.1 release(2026-10-04)
- [3]Dagger 2.60.1 build versions(2026-10-04)
- [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
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
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
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'
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
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- REST Assured7,139 Stars
2 shared tag(s) · Same language
test REST APIs from Java with a DSL for requests, status, headers, and JSON/XML assertions
Java - Signal Android29,414 Stars
2 shared tag(s)
study a large Android client built around privacy-preserving messaging
Kotlin - Gatling6,956 Stars
2 shared tag(s)
define load tests as code in Java, JavaScript/TypeScript, Kotlin, or Scala and automate performance testing in CI/CD
Scala - ZEN Engine2,034 Stars
2 shared tag(s)
define a business decision once in JSON and deliver it across runtimes
Rust - DBeaver51,949 Stars
1 shared tag(s) · 1 shared category(s) · Same language
operate many database systems from one desktop SQL workspace
Java - Firebase Android SDK2,570 Stars
3 shared tag(s) · 1 shared category(s) · Same language
develop Firebase Android SDK libraries in a Java/Kotlin Gradle monorepo with unit, integration, and Maven-local validation workflows
Java
Report incorrect information
Tell us if any listing information is incorrect or outdated.