I'm using Intellij 14.0.3. I have imported some Maven modules which declares dependencies in their pom.xml files.
In the IDE, when I'm opening a class importing an object from that dependencies, the import is shown as "on error" such as any reference to that object in this class. When I click on the error and type alt + Enter, Intellij ask me to add the dependency from Maven to the Classpath.
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 click alt + enter intellij ask me:
Add library Maven: 'joda-time:joda-time:2.1' to classpath
Why Intellij does not import Maven dependencies directly in the classpath? In Settings -> Maven -> Importing, I've checked "Import Maven projects automatically' but it still doesn't import dependencies. Try to "Make" the project with no success.
Thanks for the help.