Adding external/custom jars into Maven project

I. Using system dependency

The second method is to add the required dependency with the system scope and additionally provide an absolute path to the a jar file placed somewhere on the local disc:

You must deploy your library to folder /usr/lib/jvm/jre/lib/ext/RedshiftJDBC41-1.1.2.0002.jar.

II. Installing jar into local Maven repository

  • First we need install maven on your server follow steps by step:
  1. Run the wget command from the dir you want to extract maven too.
  2. run the following to extract the tar,
  3. move maven to /usr/local/apache-maven
  4. Next add the env variables to your ~/.bashrc file
  5. Execute these commandssource ~/.bashrc

6. Verify everything is working with the following command

  • Much better solution is to add the required dependency manually to the local repository using command:

  • For example adding external jar evalpostfix-1.0.jar to the local repository could look like this:

III. Add library by manual

  • Install 7-zip on your window and open jar file, copy your library into this jar file.

Leave a Reply

Your email address will not be published. Required fields are marked *