title: Add a java.library.path to /usr/lib/jni for scala with maven and ubuntu
body: <p>I'm trying to create a pom.xml which compile and run a program in scala.
  This project need some *.so libraries (gluegen-rt.so for example) to run. Theses files are located here : /usr/lib/jni/</p>
  
  <p>I have this error when i run my program : </p>
  
  <pre><code>Exception in thread "main" java.lang.UnsatisfiedLinkError: no gluegen-rt in java.library.path
      at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1738)
      at java.lang.Runtime.loadLibrary0(Runtime.java:823)
      at java.lang.System.loadLibrary(System.java:1028)
      at com.jogamp.gluegen.runtime.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:102)
      at com.jogamp.gluegen.runtime.NativeLibLoader.access$000(NativeLibLoader.java:51)
      at com.jogamp.gluegen.runtime.NativeLibLoader$1.run(NativeLibLoader.java:70)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.jogamp.gluegen.runtime.NativeLibLoader.loadGlueGenRT(NativeLibLoader.java:68)
      at com.jogamp.common.jvm.JVMUtil.&lt;clinit&gt;(JVMUtil.java:56)
      at javax.media.nativewindow.NativeWindowFactory.&lt;clinit&gt;(NativeWindowFactory.java:102)
      at javax.media.opengl.awt.GLCanvas.&lt;clinit&gt;(GLCanvas.java:82)
      at org.jzy3d.chart.Chart.initializeCanvas(Chart.java:65)
      at org.jzy3d.chart.Chart.&lt;init&gt;(Chart.java:56)
      at org.jzy3d.chart.Chart.&lt;init&gt;(Chart.java:39)
      at fr.iscpif.slocalfit.testGraphique$.main(testGraphique.scala:28)
      at fr.iscpif.slocalfit.testGraphique.main(testGraphique.scala)
  </code></pre>
  
  <p>So i make some research on linked library with maven, and i find this command line on a pom.xml :                         </p>
  
  <pre><code>&lt;systemProperties&gt;
  &lt;property&gt;
  &lt;name&gt;java.library.path&lt;/name&gt;
  &lt;value&gt;/usr/lib/jni/&lt;/value&gt;
  &lt;/property&gt;
  &lt;/systemProperties&gt;
  </code></pre>
  
  <p>But i don't know <strong>where i can write</strong> this lines into my pom.xml, because i want maven add this lines to java command line <strong>before</strong> i run the main class of my program ... </p>
  
  <p>Best regards,
  Thanks for help,</p>
  
  <p>My pom.xml is actually like that : </p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;fr.iscpif&lt;/groupId&gt;
      &lt;packaging&gt;bundle&lt;/packaging&gt;
      &lt;artifactId&gt;slocalfit&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.scala-lang&lt;/groupId&gt;
              &lt;artifactId&gt;scala-library&lt;/artifactId&gt;
              &lt;version&gt;${lib.org.scala-lang.scala.version}&lt;/version&gt;
              &lt;!--&lt;scope&gt;provided&lt;/scope&gt;--&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.media.opengl&lt;/groupId&gt;
              &lt;artifactId&gt;jogl-core&lt;/artifactId&gt;
              &lt;version&gt;2.0-pre-20101001&lt;/version&gt; 
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.media.opengl&lt;/groupId&gt;
              &lt;artifactId&gt;jogl-util&lt;/artifactId&gt;
              &lt;version&gt;2.0-pre-20101001&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
  
              &lt;groupId&gt;javax.media.nativewindow&lt;/groupId&gt;
              &lt;artifactId&gt;nativewindow-core&lt;/artifactId&gt;    
              &lt;version&gt;2.0-pre-20101001&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.jogamp.gluegen&lt;/groupId&gt;
              &lt;artifactId&gt;gluegen-rt&lt;/artifactId&gt;    
              &lt;version&gt;1.0-beta07&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
              &lt;artifactId&gt;commons-math&lt;/artifactId&gt;
              &lt;version&gt;3.0-SNAPSHOT&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;ca.umontreal.iro&lt;/groupId&gt;
              &lt;artifactId&gt;ssj&lt;/artifactId&gt;
              &lt;version&gt;2.4&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;gov.lbl.acs.colt&lt;/groupId&gt;
              &lt;artifactId&gt;colt&lt;/artifactId&gt;
              &lt;version&gt;1.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;jfree&lt;/groupId&gt;
              &lt;artifactId&gt;jfreechart&lt;/artifactId&gt;
              &lt;version&gt;1.0.13&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;jfree&lt;/groupId&gt;
              &lt;artifactId&gt;jcommon&lt;/artifactId&gt;
              &lt;version&gt;1.0.15&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.openmole.tools&lt;/groupId&gt;
              &lt;artifactId&gt;mgo&lt;/artifactId&gt;
              &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.openmole&lt;/groupId&gt;
              &lt;artifactId&gt;au.com.bytecode.opencsv&lt;/artifactId&gt;
              &lt;version&gt;2.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org&lt;/groupId&gt;
              &lt;artifactId&gt;jzy3d&lt;/artifactId&gt;
              &lt;version&gt;0.9&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;properties&gt;
          &lt;lib.org.scala-lang.scala.version&gt;2.9.0-1&lt;/lib.org.scala-lang.scala.version&gt;
          &lt;maven.scala.version&gt;${lib.org.scala-lang.scala.version}&lt;/maven.scala.version&gt;
      &lt;/properties&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.scala-tools&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-scala-plugin&lt;/artifactId&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;configuration&gt;
                          &lt;/configuration&gt;
                          &lt;id&gt;scala-compile-first&lt;/id&gt;
                          &lt;phase&gt;process-resources&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;add-source&lt;/goal&gt;
                              &lt;goal&gt;compile&lt;/goal&gt;
                              &lt;goal&gt;testCompile&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
              &lt;!--&lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.2&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;descriptorRefs&gt;
                          &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
                      &lt;/descriptorRefs&gt;
                      &lt;archive&gt;
                          &lt;manifest&gt;
                              &lt;mainClass&gt;${run.mainclass}&lt;/mainClass&gt;
                          &lt;/manifest&gt;
                      &lt;/archive&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;--&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt;
                  &lt;extensions&gt;true&lt;/extensions&gt;
                  &lt;configuration&gt;
                      &lt;manifestLocation&gt;target/META-INF&lt;/manifestLocation&gt;
                      &lt;finalName&gt;${symbolic.name}_${project.version}&lt;/finalName&gt;
                      &lt;instructions&gt;
                          &lt;!--&lt;Main-Class&gt;fr.iscpif.TON.PACKAGE.TaClasse&lt;/Main-Class&gt;--&gt;
                          &lt;Bundle-Name&gt;${project.groupId}.${project.artifactId}&lt;/Bundle-Name&gt;
                          &lt;Bundle-SymbolicName&gt;${project.groupId}.${project.artifactId}&lt;/Bundle-SymbolicName&gt;
                          &lt;Import-Package&gt;*;resolution:=optional&lt;/Import-Package&gt;
                          &lt;Export-Package&gt;fr.iscpif.slocalfit.*,org.apache.commons.math.*,org.openmole.tools.mgo.*,umontreal.iro.lecuyer.*&lt;/Export-Package&gt;
                          &lt;Embed-Dependency&gt;*;scope=!provided;inline=true;artifactId=!scala-library&lt;/Embed-Dependency&gt;
                          &lt;Embed-Transitive&gt;true&lt;/Embed-Transitive&gt;
                      &lt;/instructions&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
      &lt;name&gt;${project.artifactId} ${project.version}&lt;/name&gt;
  
  
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;id&gt;maven.iscpif.fr&lt;/id&gt;
              &lt;name&gt;ISCPIF repository&lt;/name&gt;
              &lt;url&gt;http://maven.iscpif.fr/public/&lt;/url&gt;
          &lt;/repository&gt;
          &lt;repository&gt;
              &lt;id&gt;maven.iscpif.fr.snapshots&lt;/id&gt;
              &lt;name&gt;ISCPIF snapshots repository&lt;/name&gt;
              &lt;url&gt;http://maven.iscpif.fr/snapshots/&lt;/url&gt;
          &lt;/repository&gt;
          &lt;repository&gt;
              &lt;id&gt;scala-tools.org&lt;/id&gt;
              &lt;name&gt;Scala repository&lt;/name&gt;
              &lt;url&gt;http://scala-tools.org/repo-releases/&lt;/url&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
  
  &lt;/project&gt;
  </code></pre>