使用 Maven 管理 DLL 依赖项 [英] Managing DLL dependencies with Maven
问题描述
我有一个 Java 程序,Maven 管理其依赖项.其中一个依赖项是另一个程序的 JNI 包装器.Maven 负责对相关 JAR 文件的引用,但我自己却在处理 DLL 文件.
I have a Java program with Maven managing its dependencies. One of those dependency is a JNI wrapper for another program. Maven takes care of the reference to the relevant JAR file, but I'm left messing around with the DLL file myself.
是否有一种让 Maven 也处理 DLL 的好方法?理想情况下,我希望将 DLL 像 JAR 文件一样加载到我们的本地存储库中.
Is there a good way of having Maven handle the DLL as well? Ideally I would like to have the DLL loaded into our local repository like the JAR file.
推荐答案
你是否尝试过这样的事情:
Did you try something like this:
<dependency>
<groupId>com.foo</groupId>
<artifactId>footron</artifactId>
<version>4.2</version>
<scope>runtime</scope>
<type>dll</type>
</dependency>
您可以将它们添加到 maven 的存储库中,如下所示:
You can add them to maven's repository with something like this:
mvn install:install-file -Dfile=footron.dll -DgroupId=com.foo -DartifactId=footron -Dversion=4.2 -Dpackaging=dll -DgeneratePom=true
尚未对 DLL 执行此操作,但应该可以.
Haven't done this for DLLs but something like this should work.
这篇关于使用 Maven 管理 DLL 依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!