Publish AAR for multiple Lib Modules

When the project contains more than one lib Module, or contains gradle Plugin Module at the same time, package the SDK and publish it to the JitPack repository:

  1. Configure the android – maven – gradle – the plugin

As with a single lib Module configuration, add dependencies in the project root directory build.gradle.

Dependencies {classpath 'com. Making. Dcendents: android - maven - gradle - plugin: 2.1'}Copy the code
  1. Configure the plugin for each module to be published

For example, there are Lib Module A, Lib Module B, and Gradle Plugin Module in the project. These three modules need to be packaged and published. Plugin needs to be applied in build.gradle for each module to be published.

apply plugin: 'com.github.dcendents.android-maven'
Copy the code

The default group:artifact:version can be used instead of group= XXX.

  1. Upload issued

After the configuration is complete and the code can be compiled properly, submit the code to GitHub. If you are officially releasing the version, create a Release on GitHub.

  1. Obtaining version Information

Log in to jitpack. IO. If you log in through GitHub authorization, the associated Repositories Repositories will be displayed directly, or search for the Repository in the Look Up column.

Select the Repository:

The Releases bar lists the latest official release information, and when the compilation package is complete, a green text icon appears in the Log column (click the “Get it” button to trigger the package if compilation is not triggered). Click on the text icon to open build.log:

Pull to the bottom of the file to see the BUILD results, and when BUILD SUCCESSFUL, look for BUILD artifacts. The real group: Artifact: Version information is shown in the red box.

Group :artifact:version Component Description: Group is com.github Repository name Artifact is the module name. Version is the Release version created

The Snapshot version is used in the development phase

You can use snapshot versions when you don’t want to rely directly on a local Module during development testing and want to use an AAR that relies on remote packaging but cannot create a Release version directly.

When committing a COMMIT, find the commit ID in the Commits or Builds column:

Then click on the text icon again to view build.log and look for group: Artifact: Version information, where Version is the COMMIT ID. You can also use feature~ migration_maven-snapshot as version, corresponding to the Feature_migration branch.