Add Local Repository for Project

Assume we want yo create a local maven repository for a project. We locate it in ./libs under the project directory. After running this script, you will see a new directory /libs created.

mvn install:install-file -Dfile=your-jar-file-name-1.0.0.jar -DgroupId=com.exmaple -DartifactId=your-jar-file-name - Dversion=1.0.0 -Dpackaging=jar -DlocalRepositoryPath=./libs

In pom.xml, add repositories:

<project ....
            <name>In Project Repo</name>

and now you can add the dependency:

  • maven/add_local_repository_for_project.txt
  • Last modified: 2021/01/06 19:39
  • by chongtin