使用 Maven 管理本机库
是否可以在maven下管理本机库(.so)?
我们使用一些依赖于外部本机库的 jar,因此我正在寻找某种方法来对它们进行 mavenize。
谢谢。
Is it possible to manage native libraries (.so) under maven?
We use some jars with dependences on external native libs, so I'm looking for some way to mavenize them.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为“常见”方法是使用分类器(例如
mylib-1.2.3-solaris.jar
)将本机库捆绑在特定于平台的 JAR 中,您可以像任何其他带有分类器的 JAR 一样依赖它:然后,使用
maven-dependency-plugin
和unpack-依赖项
mojo。另请查看之前的答案,包装原生带有 Maven 的库 帖子和部分 5.5.3。 Maven 的平台分类器:完整参考,
I think that the "common" approach is to bundle the native libraries in platform specific JARs using classifiers (e.g.
mylib-1.2.3-solaris.jar
) on which you could depend like any other JAR with classifier:And then, unpack them with the
maven-dependency-plugin
and theunpack-dependencies
mojo.Also have a look at this previous answer, the Wrapping a Native Library with Maven post and the section 5.5.3. Platform Classifiers of the Maven: the complete reference,