Skip to content

Instantly share code, notes, and snippets.

@nblagoev
Last active December 23, 2019 17:16
Show Gist options
  • Save nblagoev/41819c5f93395132d891704026a51385 to your computer and use it in GitHub Desktop.
Save nblagoev/41819c5f93395132d891704026a51385 to your computer and use it in GitHub Desktop.
Build local maven repo

Build local maven repo of local jars

  1. Create a new folder, let’s say local-maven-repo at the root of your Maven project. Just add a local repo inside your of your pom.xml:
<repositories>
    <repository>
        <id>local-maven-repo</id>
        <url>file:///${maven.multiModuleProjectDirectory or project.basedir}/local-maven-repo</url>
    </repository>
</repositories>
  1. Then for each external jar you want to install, go at the root of your project and execute:
mvn deploy:deploy-file -DgroupId=[GROUP] -DartifactId=[ARTIFACT] -Dversion=[VERS] -Durl=file:./local-maven-repo/ -DrepositoryId=local-maven-repo -DupdateReleaseInfo=true -Dfile=[FILE_PATH]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment