IntelliJ IDEA 2017.1 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

    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:
  4. Press Alt+Enter to apply import assistance.

See Also

Last modified: 18 July 2017