Resolving References with Maven
To fix unresolved reference in a Java class
- In a Java class, place the caret at an unresolved reference, and press Alt+Enter.
- From the suggestion list, choose
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.
- 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.xmlfile. Import assistant pop-up window appears at the unresolved reference:
- Press Alt+Enter to apply import assistance.
Last modified: 10 December 2015