[英]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.