I have a gradle project and I want to use dagger 2.0 in it. I don't know how to configure IntelliJ and gradle to generate files and let IntelliJ find them?
My build.gradle file looks like:
apply plugin: 'java'
apply plugin: 'idea'
version = '1.0'
repositories {
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
}
dependencies {
compile 'org.slf4j:slf4j-api:1.7.12'
compile 'org.slf4j:slf4j-simple:1.7.12'
compile 'commons-configuration:commons-configuration:1.10'
compile 'commons-collections:commons-collections:3.2.1'
compile 'com.google.dagger:dagger:2.0'
compile 'com.google.dagger:dagger-compiler:2.0:jar-with-dependencies'
compile 'com.pi4j:pi4j-distribution:1.1-SNAPSHOT'
}
In the build directory of my application the file DaggerXmlConfigurationComponent
exists, which is a component Dagger creates. But I can't use it in IntelliJ because it can't find the class.
This is not an Android application but an application for the Raspberry Pi.
You'll have to manually enable annotation processing for IntelliJ: in Settings… → Build, Execution, Deployment → Compiler → Annotation Processors, check Enable annotation processing and Obtain processors from project classpath.
I too couldn't get any of the plugins to work, so based on Stefan's response I did the following which works, but annoyingly IntelliJ seems to create group modules, which weren't there before. Be great if anyone has any idea what is causing this I would really like to get this fixed.