Installing the jar locally on your machine

Laptop

This is probably the easiest solution. You install the jar using the mvn install command into your machine’s Maven repository. This repository is usually located in the ~/.m2 directory. The jar is then installed on your physical machine for the current user, and you can use it in all your local projects just as you would in the central Maven repository.

The bad thing is that all other project members must do the same on their local machines. Even if you want to maintain your project on another physical machine, you have to install it there again. This means that you have to somehow keep a list of all the jar files that need to be installed before initializing the project, and if some jar is updated to a newer version or some other jar files are included in the project, you have to notify all the participants.

This solution is suitable when you are working on a project alone and using only one machine. When more people start collaborating on the same project, or when you need your project to be easily portable, this is not recommended.

Using system dependencies

Another simple but not recommended solution is to use jar as a system dependency. With this solution, you don’t need to install anything. You simply add your jar to the project, specifying its system path. Since the system path can be relative to the project directory, it does not need to be changed for each project member.