IntelliJ cannot find the classes in a Maven module, even if I add the jar dependency into pom.xml.
I created a Maven module: test-intellij . And then I created a class TestApp
and made it implements ApplicationContextAware
as below:
public class TestApp implements ApplicationContextAware{
}
IntelliJ told me: "can not find class ApplicationContextAware". So I pressed "alt + enter", then from the popup tips I chose "Add maven dependency".
After this operation, the dependency below was added into pom.xml successfully:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.1.3.RELEASE</version>
</dependency>
But when I try to import the ApplicationContextAware class , IntelliJ still cannot find the ApplicationContextAware class to import.
Could anybody help me to solve this issue?
Try to Reimport the Maven project using the corresponding button in IntelliJ IDEA Maven Projects
tool window. Wait until the dependency is downloaded and indexing is complete. File
| Invalidate Caches
may also help.
Also check that you are using the latest IDEA version (12.0.2 at the moment). You should be able to browse inside the downloaded dependency jar in the Project View
, External Libraries
node.
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