![maven install to local directory maven install to local directory](https://aws1.discourse-cdn.com/standard21/uploads/robotframework1/original/1X/702e61576ed30f6975fd86c11bd2a46402311868.png)
Hope this article has provided you good insights as how to add external jar file to local maven repository and why do we need to follow the first approach. So, for simple projects you can use the approach 2, but if you want to generate a single flat jar file out of multiple maven projects, you will not be able to succeed with approach 2. Maven does not support to pick the jar file which specified in the format as mentioned in approach 2. Also, when we actually try to create a single jar / flat jar file that is created out of multiple dependent maven projects.
![maven install to local directory maven install to local directory](https://www.jfrog.com/confluence/download/attachments/97649294/MavenXMLView.jpg)
In that case, you simply need to re-compile them and install them by running mvn clean install in each project folder.They will get uploaded to the repository. The main project which will include the sub project, will not be able to access the classes and methods which are present as part of the sub project’s jar file. Its perfectly safe to delete the folder.m2/repository as maven will re-download all the needed dependencies when needed except for your local projects.
m2 directory is likely to be hidden, we'll need to change the directory properties in order to display it.
MAVEN INSTALL TO LOCAL DIRECTORY FULL
You can even provide a hard coded or full absolute path instead of the above notation. To install the claim-manager jar file to the local repository we can execute the command as below. Our local Maven repositories are stored in different locations based on the operating system. $ refers to your project’s base directory and the remaining part is the path to your jar from the base directory. And in the path we need to specify the path where jar file is located. Follow the instructions at to download and install Maven for your local development environment. That is you can call the respective classes and methods which are part of the included jar file.Ībove is the example based on the syntax provided by maven. This approach allows you to include jar file as part of your maven project and be able to work in eclipse properly. To install Apache Maven on Windows, you just need to download the Maven’s zip file, unzip it to a folder, and configure the Windows environment variables.