I am your private JAR, do what you want me to do
– or how to use local JARs in your Maven based project

I think it’s a quite common case in most of the projects. You have this one or two fancy JARs that are part of your project and you have to import them into Java application that is build using Maven. To get it solved, you have to do following.

First of all, create your local repository inside your project

mvn org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install-file  \
    -Dfile=${HOME}/tmp/your_custom_library.jar \
    -DgroupId=org.custom -DartifactId=component \
    -Dversion=1.0.0-SNAPSHOT -Dpackaging=jar \
    -DlocalRepositoryPath=`pwd`/external_jars

Note that group, and artefact can be chosen arbitrary. Once you have your JAR inside your local repo, you can use it inside pom.xml.

<project ...>

  ...
  ...

  <repositories>
    <repository>
      <id>external_jars</id>
      <url>file:///${project.basedir}/external_jars </url>
    </repository>
  </repositories>

  ...
  ...
  
  <dependencies>
    <groupId>org.custom</groupId>
    <artifactId>component</artifactId>
    <version>1.0.0-SNAPSHOT</version>
  </dependencies>

  ...
  ...

</project>