skip to content

How to test bugfix of Android Library without publishing a Snapshot

When you deal with a bug in a Library in Android Project, there are 2 things you can do.

  • Either publish a Snapshot version with the bugfix released
  • Or publish it locally and reflect any changes

How to publish locally?

These commands publish the local version of a Library if you have access to the source code.

Terminal window
./gradlew clean
./gradlew build
./gradlew publishToMavenLocal

Once finished, all *.pom and *.aar files will be located inside ~/.m2 folder.

The publishToMavenLocal is a built-in task of the maven-publish plugin of Gradle, and it will not publish anything into the remote Artifactory (JCenter / Maven) at all.

How to see the local version changes?

  • Add mavenLocal() as repository location.
  • Make sure mavenLocal() is in the first position.
  • Make sure to use the correct version of the library
  • Use the appropriate extension of the dependency.

Important Note

This note requires publishing block to be set up in the target project. In the future, look for this article for more information.