IntelliJ IDEA 14.0.0 Web Help

Resolving References with Maven

To fix unresolved reference in a Java class

  1. In a Java class, place the caret at an unresolved reference, and press Alt+Enter.
  2. From the suggestion list, choose Add Maven Dependency
    maven_references1.png

    The Maven Artifact Search dialog box opens with the Search for class tab having the focus, and with the reference in question as the search string.

  3. Select the desired dependency, and click Add. IntelliJ IDEA downloads the necessary libraries and rebuilds indices, and adds the corresponding <dependency> element to the pom.xml file. Import assistant pop-up window appears at the unresolved reference:
    maven_references.png
  4. Press Alt+Enter to apply import assistance.

See Also

Concepts:

Web Resources:

Last modified: 4 December 2014
comments powered by Disqus