Using SIGAR with maven

I am currently trying to use Sigar in maven-build, and it says every time:

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

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

I tried to find answers that basically say that you need to unzip files, such as Unzip a dependency in maven . Unpacking (after installing other things through install: install-file) works fine, but the file is not included in this path.

Then I tried to find something to include the files in the build path, so I did something like this: Surefire JUnit Testing using my own libraries (I want to use cigars in tests), but that also doesn’t change anything. I tried it with many different folders and even added the file itself, and not the folder it got 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 am using maven 2.2.1.

Can someone tell me how to make a cigar work in this context?

Thanks in advance, DaGeRe

+5
source share
1 answer

Using the surefire plugin, you do not need prefix arguments with the "D" prefix (for example, -java.library.path = $ {project.build.directory} /lib/libsigar-x86-linux.so).

0

All Articles