Local Maven Repository and Libraries
Are you tired of waiting for a snapshot or a new version to be published? — Why not doing it yourself locally?
Published in
3 min readJun 11, 2018
I have rewrote this story to make it more valuable for the readers.
Local Maven Repository
If what you want is just to store your Android libraries or modules locally as a maven repository into your computer, and import the dependency directly in your project like if it were really published:
implementation 'com.example:my-library:x.y.z'
All you need to do is the following:
- Enable
mavenLocal
repositories into your build system and apply anyandroid-maven
plugin to your library’sbuild.gradle
file.
buildscript {
repositories {
mavenLocal()
}
}
plugins {
// This plugin allows publishing android libraries
id "com.github.dcendents.android-maven" version "2.0"
}
- Also configure a
mavenInstaller
inside your library’sbuild.gradle
file.
install {
repositories.mavenInstaller {
pom.groupId = 'com.example'
pom.version = 'x.y.z'
pom.artifactId = project.name
}
}