using local jar in maven code example

Example 1: maven use local dependency jar

<dependency>
    <groupId>com.sample</groupId>
    <artifactId>sample</artifactId>
    <version>1.0</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/src/main/resources/Name_Your_JAR.jar</systemPath>
</dependency>

Example 2: using local jar in maven

Create a new folder, let's say local-maven-repo at the root of your Maven project.

Just add a local repo inside your <project> of your pom.xml:


<repositories>
    <repository>
        <id>local-maven-repo</id>
        <url>file:///${project.basedir}/local-maven-repo</url>
    </repository>
</repositories>