I had a situation where I have been learning Maven more and more every day and with the new application I was writing, I was splitting the code into separate maven modules/JARs.  When I was first setting up my projects, I soon came to realize that I should not do things the ole fashion way, but adding JARs to the classpath of the project etc via the IDE, since my projects were all Maven based, I wanted my JAR to be included in the pom.xml as a dependency so that I could build my components with the mvn install command.  That is where I learned the concept of adding my JAR to my local Maven repos.  So here’s a great write up that shows you how to do this using the mvn install:install-file task


Once you have your JAR in your local repos, you can refer to the JAR by the Artifact ID, Group ID and version in your project pom.xml.