How to upload an Android library to local maven repository
Install maven
In the library project’s top build.gradle file, add this: apply plugin: 'maven'
Add this:
uploadArchives { repositories { mavenDeployer { repository(url: "file:////home/hillol/.m2/repository") pom.groupId = 'edu.njit.avatar.sharedlib' pom.artifactId = 'shared-lib' pom.version = '1.0.0' } } }
Now, after building the project, execute gradle task “uploadArchives”
To use this library:
In the build.gradle file of the app’s module (not the top one), add this inside the android{} block, add:
repositories { mavenLocal() }
Inside the dependencies block, add:
compile 'edu.njit.avatar.sharedlib:shared-lib:1.0.0'













