简体   繁体   English

将外部依赖项上传到本地Maven存储库

[英]Upload external dependencies to local maven repository

I try to use local publishing for my sdk, then compile it in main app project. 我尝试将本地发布用于我的SDK,然后在主应用程序项目中对其进行编译。

So the apply : 所以适用:

apply plugin: 'maven-publish'

with the command ./gradlew publishToMavenLocal 使用命令./gradlew publishToMavenLocal

But seems that external dependencies are not uploaded 但是似乎外部依赖项没有上传

在此处输入图片说明

So build errors appear 因此出现构建错误

在此处输入图片说明

full log link 完整的日志链接

How to handle these external dependencies? 如何处理这些外部依赖关系?

Thanks 谢谢

Publishing in Gradle will not publish transitive dependencies. 在Gradle中发布不会发布可传递依赖项。 Otherwise once new artifact version will be published (eg Spring) you will also publish everything with it (eg log4j) which is already published and will fail. 否则,一旦新的工件版本将被发布(例如Spring),您还将随它一起发布已经发布并且将失败的所有内容(例如log4j)。

So if you want to compile your project, you have to specify both Maven Local (for your artifact) and Maven Central (for external artifacts) in repositories{} clause : 因此,如果要编译项目,则必须在repositories{}子句中同时指定Maven Local(对于您的工件)和Maven Central(对于外部工件)

repositories {
    mavenLocal()
    mavenCentral()
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM