Back

June 24, 2022

Resolving Maven Dependencies Using IntelliJ

Overview

  1. Set up Maven project in IntelliJ
  2. Basic knowledge of Maven
  3. The Maven tab in IntelliJ
  4. Update dependencies of your maven project

Set Up Maven Project in IntelliJ

  1. Navigate to File > Project Structure > Modules
  2. Click on + > Import Exisiting Project

Basic Knowledge Of Maven

Minimally, you should know that a dependency has the following defined:

  1. Group
  2. Artifact
  3. Version

The Maven Tab In IntelliJ

Two ways to open up the Maven tab:

  1. By default, the Maven tab is collapsed on the right side of IntelliJ. Simply click and the Maven tab will open up
  2. Use CTRL+SHIFT+A and search for Maven

On the Maven tab, you will see a list of Maven projects that are imported into IntelliJ. When you expand a project, you will see:

  1. Lifecycle
  2. Dependencies

Lifecyle

  1. clean
  2. compile
  3. test
  4. package
  5. verify
  6. install
  7. site
  8. deploy

Dependencies

This expands as a tree to all the dependencies of the Maven project.

Each entry shows the group, artifact, and version that is eventually resolved and imported for the project based on pom.xml.

Update Dependencies Of Your Maven Project

The following are the typical steps to execute:

  1. Make changes in pom.xml (Remember to save the file!)
  2. Reimport dependencies
  3. Verify that libraries and versions are updated properly
  4. Resolve errors in source code
  5. Run application