我在maven项目中使用sigar API,我已将sigar maven依赖项和log4j
依赖项添加到pom
文件中,但是当我构建项目时,它会出现以下错误
DEBUG Sigar - no libsigar-x86-linux.so in java.library.path
org.hyperic.sigar.SigarException: no libsigar-x86-linux.so in java.library.path
我手动将libsigar-x86-linux.so
文件添加到maven本地存储库时修复了错误,如何使用pom
文件自动配置?
答案 0 :(得分:0)
maven依赖插件存在问题。您必须添加.so类型作为包含类型,如下所示:
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>native-dep</id>
<phase>compile</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<stripVersion>true</stripVersion>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<includeGroupIds>org.hyperic</includeGroupIds>
HERE -> <includeTypes>dll,so</includeTypes>
</configuration>
</execution>
...
</executions>
</plugin>