Android 库 : maven vs maven-publish gradle project

标签 android gradle android-gradle-plugin

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

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

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

也很有趣 - Android 工具团队 deprecated the experimental gradle plugin这是基于 SoftwareComponent 模型 - 这是 maven-publish 插件使用的。 maven-publish 是否也被弃用了?

最佳答案

我建议您使用新的 maven publish plugin . Gradle 弃用了旧的 maven plugin使用 Gradle 1.3。据此Gradle blog post只有部分 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. 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 使用它:https://github.com/realm/realm-java/blob/master/realm/realm-library/build.gradle

关于Android 库 : maven vs maven-publish gradle project,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48469235/

相关文章:

android - Android 中使用 ksoap2 的 NTLM 身份验证

android - 基于 BuildType 的 Gradle 模块替换

android - 如何在Android Studio中检查依赖项的依赖项

spring-boot - 使用 docker :dind service 在 GitLab CI/CD 中 Gradle bootBuildImage 失败并显示 'No digest found'

gradle - 从项目依赖项中排除项目依赖项

java - Android NDK 使用 gradle 和 jitpack 引入 JNI 东西?

android - 有没有办法可以找出哪个 ndk 版本用于编译 android .so 共享库?

android - Android 2.3 中性能问题的内部连接顺序

Android 如何在键盘弹出时忽略自动调整大小?

带有 gradle 插件 2.0.0-alhpa8 的 Android studio 2.0 Preview 8,内存警告尽管堆大小为 4Gb