I am using Intellij 14.0.3. I have imported some Maven modules that declare dependencies in their pom.xml files.
In the IDE, when I open a class that imports an object from these dependencies, the import is displayed as "on error", for example, any reference to this object in this class. When I click on the error and type alt + Enter, Intellij will ask me to add a dependency on Maven to the class path.
Example:
In my pom I have:
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>${joda.version}</version>
</dependency>
In my class, I have the following import on error:
import org.joda.time.DateTime;
When I press alt + type intellij, ask me:
Add library Maven: 'joda-time:joda-time:2.1' to classpath
Intellij Maven ?
→ Maven → Import, " Maven ", - . "" .
.