Sometimes, you find a custom library on the internet, or create it by yourself for something special. Probably, you cannot find those kind of libraries in maven repositories and add your maven dependencies for your maven based projects. But, if you need special library in your maven dependencies to package your project, there is a maven feature that enables you to install this library to your local maven repository.
For example I will show you how to add Oracle jdbc driver to your repository. I have Oracle XE in my computer and if you go to this path “C:\oraclexe\app\oracle\product\11.2.0\server\jdbc\lib” you will find Oracle drivers for your use. Or you can just download it from on the internet. Now let’s open a console and write this command:
mvn install:install-file -Dfile="C:\oraclexe\app\oracle\product\11.2.0\server\jdbc\lib\ojdbc6.jar" -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0 -Dpackaging=jar
Then you can add this library to your pom.xml like below. Be careful that groupId, artifactId and version are identical with the command above.
<dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc6</artifactId> <version>11.2.0</version> </dependency>