gpt4 book ai didi

java - 如何将 NAR 依赖项添加到 Maven pom 文件?

转载 作者:行者123 更新时间:2023-11-29 09:22:24 33 4
gpt4 key购买 nike

我正在尝试使用 JNI,并且正在使用 maven-nar-plugin 将 C++ 代码打包到 NAR 中。现在,我想将此代码包含在另一个 Java 项目中。我该如何正确地执行此操作?

最佳答案

这取决于你想如何使用 maven nar 插件创建的依赖项。来自documentation ,

Other maven projects may specify dependencies on these nar files using the standard maven dependency declaration. Nar files get downloaded, unpacked and installed in the local maven repository, just like jar files are (apart from the unpacking).

FAQ有一节介绍如何从 Java 代码加载 native 库。

希望这些帮助。

关于java - 如何将 NAR 依赖项添加到 Maven pom 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5491805/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com