title: Bundle native dependencies in runnable .jar with Maven
body: <p>I have a project managed in Maven that has some <strong>native dependencies</strong> (<a href="http://www.lwjgl.org/" rel="noreferrer">LWJGL</a>).</p>
  
  <p>Everything works fine in development, but now I want to set up Maven so that it will build a runnable .jar file that I can redistribute. In particular, I want it to be very easy for users to run the app without having to mess around with library paths or unpacking native libraries etc.</p>
  
  <p>Currently I am able to build a .jar file that includes all the dependencies, but if I run it then (unsurprisingly) I get an unsatisfied link error:</p>
  
  <pre><code>Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.libr
  ary.path
          at java.lang.ClassLoader.loadLibrary(Unknown Source)
          at java.lang.Runtime.loadLibrary0(Unknown Source)
          at java.lang.System.loadLibrary(Unknown Source)
          at org.lwjgl.Sys$1.run(Sys.java:73)
          at java.security.AccessController.doPrivileged(Native Method)
          at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
          at org.lwjgl.Sys.loadLibrary(Sys.java:95)
          at org.lwjgl.Sys.&lt;clinit&gt;(Sys.java:112)
          at org.lwjgl.opengl.Display.&lt;clinit&gt;(Display.java:132)
          at glaze.TestApp.start(TestApp.java:10)
          at glaze.TestApp.main(TestApp.java:31)
  </code></pre>
  
  <p>Obviously I can make it work by manually installing the native libraries and running the jar with <code>java -Djava.library.path=/path/to/libs</code> but that isn't something I can expect my users to do.</p>
  
  <p>Here's the pom.xml in case it is relevant: <a href="https://github.com/mikera/glaze/blob/master/pom.xml" rel="noreferrer">https://github.com/mikera/glaze/blob/master/pom.xml</a></p>
  
  <p>It is possible to set up Maven so that it will create a runnable .jar that includes the native dependencies and will run successfully when double-clicked?</p>