Android库:maven vs maven-发布gradle项目 [英] Android Libraries: maven vs maven-publish gradle project

查看:102
本文介绍了Android库:maven vs maven-发布gradle项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个大型的多模块Android库,并且需要将该库发布给内部公司Artifactory.

I'm building a large multi-module Android library, and need to publish the library to an internal company Artifactory.

我应该使用旧的 maven 插件,还是新的 maven-publish 插件?

注意:以上两个官方插件并不完全支持Android,因此有两个社区端口.

Note: The above two official plugins don't fully support Android, so there are two community ports.

也很有趣-Android工具小组弃用了实验性gradle插件基于SoftwareComponent模型-maven-publish插件使用的模型.那么maven-publish也被弃用了吗?

Also interesting - the Android Tools team deprecated the experimental gradle plugin that was based around the SoftwareComponent model - which is what the maven-publish plugin uses. Is maven-publish deprecated too then?

推荐答案

我建议您使用新的 maven插件.根据此 Gradle博客帖子的一部分,软件组件模型将被标记为已弃用,其余的将被移植:

I would recommend you to use 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:

...因此,您可能想知道软件模型正在发生什么.我们正在将本机支持的配置DSL移植到当前模型中.因此,声明性和强大的建模语言将是相同的.不推荐使用属于软件模型的规则引擎.模型模块下的所有内容都将被移植为当前模型的扩展...

... 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 ...

如果需要maven-publish的示例,Realm-Java将使用它:

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

这篇关于Android库:maven vs maven-发布gradle项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆