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.
The Gradle tool window is enabled automatically when you create or open your Gradle project. Click Gradle on the right sidebar to open the tool window. The tool window displays the Gradle linked projects, their tasks, dependencies, and all changes made to the underlying build. gradle file.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With