Back
June 24, 2022
Resolving Maven Dependencies Using IntelliJ
Overview
- Set up Maven project in IntelliJ
- Basic knowledge of Maven
- The Maven tab in IntelliJ
- Update dependencies of your maven project
Set Up Maven Project in IntelliJ
- Navigate to
File
> Project Structure
> Modules
- Click on
+
> Import Exisiting Project
Basic Knowledge Of Maven
Minimally, you should know that a dependency has the following defined:
- Group
- Artifact
- Version
The Maven Tab In IntelliJ
Two ways to open up the Maven tab:
- By default, the Maven tab is collapsed on the right side of IntelliJ. Simply click and the Maven tab will open up
- 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:
- Lifecycle
- Dependencies
Lifecyle
- clean
- compile
- test
- package
- verify
- install
- site
- 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:
- Make changes in
pom.xml
(Remember to save the file!)
- Reimport dependencies
- Verify that libraries and versions are updated properly
- Resolve errors in source code
- Run application