From: Brian L. <blu...@gm...> - 2011-05-31 17:36:10
|
Hi folks, having some issues building maven and SIGAR using the native libs. Any ideas on how to create a custom .pom file and set any necessary config values to have maven create a build with SIGAR bundled and point itself to the proper native libs as well? Ultimately what I'd like to do is create a .war file (or .jar) that has the .dylib/.so native extensions bundled inside, however this may not be possible. If not, what is the best way to set the java.library.path value for maven builds? Here's a snippet of what I'm doing here in the .pom file: <!-- need to copy/unzip the SIGAR native libraries to the target directory and tell SIGAR where they are --> <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <phase>process-test-resources</phase> <configuration> <tasks> <echo>SIGAR java library version used is ${sigar.version}</echo> <echo>Copying/unzipping SIGAR native libraries (version ${sigar.version}) to local build directory</echo> <mkdir dir="${project.build.directory}/jboss-sigar" /> <copy toDir="${project.build.directory}/jboss-sigar"> <fileset dir="${settings.localRepository}/org/hyperic/sigar-dist/${sigar.version}" includes="*.zip" /> </copy> <unzip dest="${project.build.directory}/jboss-sigar"> <fileset dir="${project.build.directory}/jboss-sigar" includes="*.zip" /> <patternset> <include name="**/lib/sigar.jar" /> <include name="**/lib/bcel*.jar" /> <include name="**/lib/*.so" /> <include name="**/lib/*.sl" /> <include name="**/lib/*.dll" /> <include name="**/lib/*.dylib" /> </patternset> </unzip> <move todir="${project.build.directory}/jboss-sigar" flatten="true"> <fileset dir="${project.build.directory}/jboss-sigar"> <include name="**/lib/*" /> </fileset> </move> <delete dir="${project.build.directory}/jboss-sigar/hyperic-sigar-${sigar.version}" /> </tasks> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> Can you let me know how you folks are handling this? Thanks! |