Android Libraries: maven vs maven-publish gradle project

Solution 1:

I would recommend you to use the new maven publish plugin. Gradle deprecated the old maven plugin with Gradle 1.3. According to this Gradle blog post only parts of the SoftwareComponent model will be marked as deprecated and the rest is going to be ported:

... You may therefore be wondering what is happening to the Software Model. We’re in the process of porting the configuration DSL of the native support to the current model. So the declarative nature and strong modelling language will be the same. The rule engine that was part of the Software Model will be deprecated. Everything under the model block will be ported as extensions to the current model ...

If you want an example for the maven-publish, Realm-Java uses it: https://github.com/realm/realm-java/blob/master/realm/realm-library/build.gradle