If you’ve ever wondered whether you can upload your own libraries as a dependency using Maven, the answer is yes, you can. And it is really simple.
It’s a 2-step process.
Step 1
Navigate to your Maven project path in the command line and to upload a library, that’s the structure of the maven command:
mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>
Step 2
After you have specified a library to be included using the command above, you need to add the dependency into the dependencies tab.
<dependency> <groupId>group-id</groupId> <artifactId>artifact-id</artifactId> <version>version</version> <type>jar</type> </dependency>
After you have added it as a dependency, simply build the project using mvn package and boom, you have added a custom library to your Maven project.