How to Add Local Maven Repository to Project
To load the local Maven repository, you can follow these steps:
- Open the pom.xml file of the Maven project and locate the tags.
- Configure local Maven repository in the tags, for example:
<repositories>
<repository>
<id>local-maven-repo</id>
<url>file://${user.home}/.m2/repository</url>
</repository>
</repositories>
Here, ${user.home} represents the user’s home directory, and .m2/repository is the default path for the local Maven repository.
- Save the pom.xml file and rebuild the Maven project.
This way you can load the dependencies in the local Maven repository. If the local repository path is different, you can modify the path in the tag according to the actual situation.