[英]Android Libraries: maven vs maven-publish gradle project
I'm building a large multi-module Android library, and need to publish the library to an internal company Artifactory. 我正在构建一个大型的多模块Android库,需要将该库发布到内部公司Artifactory。
Should I use the old maven
plugin, or the new maven-publish
plugin? 我应该使用旧的maven
插件还是新的maven-publish
插件?
Note: The above two official plugins don't fully support Android, so there are two community ports. 注意:以上两个官方插件并不完全支持Android,因此有两个社区端口。
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. 同样有趣的是 - Android Tools团队弃用了基于SoftwareComponent模型的实验性gradle插件 - 这是maven-publish
插件使用的。 Is maven-publish
deprecated too then? maven-publish
被弃用了吗?
I would recommend you to use new maven publish plugin . 我建议你使用新的maven发布插件 。 Gradle deprecated the old maven plugin with Gradle 1.3. Gradle用Gradle 1.3弃用了旧的maven插件 。 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: 根据这篇Gradle博客文章,只有部分SoftwareComponent模型将被标记为已弃用,其余部分将被移植:
... 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. 我们正在将本机支持的配置DSL移植到当前模型。 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 如果你想要一个maven-publish
的例子,Realm-Java使用它: https : //github.com/realm/realm-java/blob/master/realm/realm-library/build.gradle
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.