简体   繁体   English

在完整的Java项目中向Kotlin上的库添加依赖项

[英]Adding a dependency to library on Kotlin in full Java-project

I created a simple library ( AAR ) on the Kotlin , when called up, interacts with the other application through the Broadcast mechanism. 我在Kotlin上创建了一个简单的库( AAR ),当它被调用时,它通过Broadcast机制与其他应用程序进行交互。 And now I had a question: how to properly connect it to third-party developers, as a file (not Maven), that them do not have to install a dependency on the Kotlin ? 现在我有一个问题:如何将其作为file (不是Maven)正确连接到第三方开发人员,而不必在Kotlin上安装依赖项?

You cannot: Kotlin compiles to class files and executes on the JVM, yes... But they depend on the Kotlin runtime... Also note that your Gradle dependencies are not nested forward, meaning that either you include the jars (causing duplicate clases conflicts if the end user wants to use the same library) or you inform in the docs. 您不能:Kotlin编译为类文件并在JVM上执行,是的。但是它们依赖于Kotlin运行时...。另外请注意,您的Gradle依赖项没有向前嵌套,这意味着您包括了jars(导致重复的clases)如果最终用户要使用相同的库,则会发生冲突),或者您在文档中告知。 Alternatively you can use a private Maven repository that can include a file with nested dependencies. 或者,您可以使用私有Maven存储库,该存储库可以包含具有嵌套依赖项的文件。

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

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