Fork me on GitHub

Publishing with the Google Play Developer API

Maven Publisher

With help of the Google Play Developer API it is now possible to automatically publish APKs, update store listings, etc.

A Gradle plugin for this was already created on which we based the Maven Mojo’s.

At the moment there are Mojo’s for uploading APKs and updating the store listing including screen shots, feature graphics etc. Both can be used inside a project or in a stand alone fashion, but in both cases you need the publisher email and a p12 key file. How to obtain these can be found here.

It is possible to pass the email and key file as arguments in the command line but the preferred way is to setup a profile in settings.xml:

        <>publisher email</>
        <>path to p12 key file</>

If you want to use the publisher outside of a project, you will need to supply the other required values:

<android.publisher.apkpath>path to APK</android.publisher.apkpath>
<>project title</>
<>path to listing directory</>
<>project package name</>

Again these can be supplied in the commandline or added to the profile.

To update the listing comply to the following structure:

- [src]
  + - [main]
      + - [play]
          + - [en-US]
          |   + - [listing]
          |   |   + - fulldescription.txt
          |   |   + - shortdescription.txt
          |   |   + - title.txt
          |   + - whatsnew.txt
          + - [de-DE]
              + - [listing]
              |   + - fulldescription.txt
              |   + - shortdescription.txt
              |   + - title.txt
              + - whatsnew.txt
The text files are the default values, which can be changed by setting the corresponding parameters. For example android.publisher.filename.whatsnew=newinversion2.xml

If you want to update images in the listing as well, set the following attribute to true:


And comply to the structure:

- [src]
  + - [main]
      + - [play]
          + - [en-US]
              + - [listing]
                  + - [featureGraphic]
                  + - [icon]
                  + - [phoneScreenshots]
                  + - [promoGraphic]
                  + - [sevenInchScreenshots]
                  + - [tenInchScreenshots]
This structure is the same as the one used in the Gradle plugin, so both plugins can be used if this structure is followed.


To upload an APK to the Play store, use the following command

mvn android:publish-apk -Ppublisher

To update the store listing with new images

mvn android:publish-listing -Ppublisher -Dandroid.publisher.upload.images=true
By default the APK will be uploaded to the alpha track in the Play store, to change this set the android.publisher.track parameter (see Tracks).