Just a quick post on how to setup Dagger 2 with maven to compile without messing with eclipse settings. Just remember to include target/generated-sources to your class-path.
< project xmlns = "http://maven.apache.org/POM/4.0.0" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance"
xsi: schemaLocation = "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
< modelVersion > 4.0 . 0 </ modelVersion >
< groupId > com . beond </ groupId >
< artifactId > ZZTest </ artifactId >
< version > 0.0 . 1 - SNAPSHOT </ version >
< dependencies >
< dependency >
< groupId > com . google . dagger </ groupId >
< artifactId > dagger </ artifactId >
< version > 2.0 </ version >
</ dependency >
< dependency >
< groupId > com . google . dagger </ groupId >
< artifactId > dagger - compiler </ artifactId >
< version > 2.0 </ version >
< optional > true </ optional >
</ dependency >
</ dependencies >
< build >
< plugins >
< plugin >
< artifactId > maven - compiler - plugin </ artifactId >
< version > 3.0 </ version >
< configuration >
< source > 1.8 </ source >
< target > 1.8 </ target >
</ configuration >
< dependencies >
< dependency >
< groupId > com . google . dagger </ groupId >
< artifactId > dagger - compiler </ artifactId >
< version > 2.0 </ version >
< optional > true </ optional >
</ dependency >
</ dependencies >
</ plugin >
</ plugins >
</ build >
</ project >