简体   繁体   English

如何使用Maven为依赖项设置本机库?

[英]How can I set the native library for a dependency using maven?

I am using microsoft tfs sdk jar which requires a native library. 我正在使用需要本机库的Microsoft tfs sdk jar。 I can set the native library using : System.setProperty("com.microsoft.tfs.jni.native.base-directory","C:\\path\\"); 我可以使用以下方法设置本机库: System.setProperty("com.microsoft.tfs.jni.native.base-directory","C:\\path\\");

I am now using a maven project and the tfs sdk jar is a maven dependeny How can I set the native library for the dependency using maven ? 我现在正在使用Maven项目,而tfs sdk jar是Maven依赖的。如何使用Maven为依赖项设置本机库?

You need to use a "Native Lib Loader" helper. 您需要使用“本地库加载程序”帮助器。

The source to one is here: https://github.com/scijava/native-lib-loader 源代码在这里: https//github.com/scijava/native-lib-loader

Best via Maven/Gradle or similar: http://mvnrepository.com/artifact/org.scijava/native-lib-loader/ 最好通过Maven / Gradle或类似的网站访问: http : //mvnrepository.com/artifact/org.scijava/native-lib-loader/

Where you need to add the natives to the project and the required naming convention ca be found in "org.scijava.nativelib.NativeLibraryUtil" 您需要在项目中添加本机的地方,并且可以在“ org.scijava.nativelib.NativeLibraryUtil”中找到所需的命名约定。

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

相关问题 如何使用Maven插件向嵌入式tomcat添加依赖项? - How can I add a dependency to embedded tomcat using the maven plugin? 如何将JDT添加为Maven依赖项? - How can I add JDT as a Maven dependency? 而不是使用Maven引入第三方依赖,我如何直接将该依赖的源实现到我的项目中? - Instead of using Maven to pull in a third party dependency, how can I implement the source of that dependency directly into my project? 如何使用NetBeans将Maven库添加到ant项目 - how can I add a Maven library to an ant project using netbeans 如何在具有依赖关系的Maven项目中添加专有库? - How can add the proprietary library in maven project with dependency? 如果我在依赖关系树中看不到它,如何从 Maven 中排除该库? - How to exclude the library from Maven if I do not see it in the dependency tree? 如何将storm mongo库添加为maven依赖项? - How do I add the storm mongo library as a maven dependency? 如何将Maven项目用作另一个Maven项目的依赖项? - How can I use a Maven project as a dependency to another Maven project? 如何设置 Maven 依赖的 URL - How to set URL for Maven dependency 如何使用配置文件 maven 指定 Spring 引导启动器依赖项的版本? - How can I specify version of Spring Boot starter dependency using profile maven?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM