5

I'm currently trying to use Sigar in a maven-build, and it says everytime:

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

I've installed Sigar to maven with mvn install:install-file -DgroupId=org.hyperic -DartifactId=sigar -Dversion=1.6.4 -Dpackaging=jar -Dfile=sigar.jar (where sigar.jar is a jar only with the files in the org-folder, and the maven dependency with the things in the lib-folder), but then it does not find the .so-file.

I've tried to find answers, who mostly say one should unzip the files like Unzip dependency in maven . Unzipping (after installing the other things via install:install-file) does work fine, but the file isn't included in the path after all.

Then I've tried to find something to include the files in the build path, so I did something like this: Surefire JUnit Testing using Native Libraries (I want to use sigar in the tests), but this also doesn't change anything. I've tried it with many different folders, and even adding the file itself and not the folder it is in to the library path, but even this:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <configuration>
    <forkMode>once</forkMode>
    <argLine>-Djava.library.path=${project.build.directory}/lib/libsigar-x86-linux.so</argLine>
  </configuration>
</plugin>

does not work, but the file is clearly there. I'm using maven 2.2.1.

Has anybody an hint how to get sigar in this context working?

Thanks in advance, DaGeRe

Community
  • 1
  • 1
David Georg Reichelt
  • 963
  • 1
  • 15
  • 36

1 Answers1

0

Using surefire plugin you do not need to prefix arguments with 'D' prefix (e.g. - -java.library.path=${project.build.directory}/lib/libsigar-x86-linux.so).

Mike
  • 209
  • 1
  • 11
  • 2
    Thanks for the advice, but the answer to the question was, after some trying and googling again, to add target to the configuration. I thought, ${project.build.directory} would include this, but it didn't. – David Georg Reichelt May 06 '13 at 16:09
  • @DavidReichelt: why don't you post this as your own answer and accept it? – lakshman Apr 22 '14 at 16:25