2014-11-21 124 views
0

我在maven項目中使用sigar API,我已經將sigar maven dependencies和log4j依賴項添加到pom文件中,但是當我構建項目時它提供了以下錯誤,當我手動添加了libsigar-x86-linux.so文件到本地Maven回購如何在maven項目中自動配置sigar與libsigar-x86-linux.so

DEBUG Sigar - no libsigar-x86-linux.so in java.library.path 
org.hyperic.sigar.SigarException: no libsigar-x86-linux.so in java.library.path 

錯誤是固定的,怎樣纔可以使用pom文件自動配置?

回答

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> 
相關問題