How to add Maven dependencies to an idea project?
To add Maven dependencies, you can follow these steps:
- Open the pom.xml file of the project.
- Add the dependencies you want to include inside the tag.
- Within the tag, each dependency is defined using a tag.
- Within the tag, use the tags
, , , and to specify the coordinates of the dependencies. - and so on.
- Save the pom.xml file.
Here is an example of how to add dependencies.
<dependencies>
<dependency>
<groupId>org.example</groupId>
<artifactId>my-library</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
In this example, we added a dependency called “my-library” with the coordinates “org.example:my-library:1.0.0”.
After saving the pom.xml file, Maven will automatically download and add the necessary dependencies to the project.