title: NoSuchFieldError: RESOURCE_PREFIX with a maven project using tess4j
body: <p>tess4j is an OCR packed with native library, I made a maven project to test it,
  I did add the installation path of maven to eclipse.
  I added M2_HOME, MAVEN_HOME and JAVA_HOME env variable,</p>
  
  <p>here is my parent pom</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.mssb.ongoing&lt;/groupId&gt;
      &lt;artifactId&gt;ongoing-parent&lt;/artifactId&gt;
      &lt;packaging&gt;pom&lt;/packaging&gt;
      &lt;version&gt;1.0&lt;/version&gt;
      &lt;name&gt;ongoing&lt;/name&gt;
  
      &lt;modules&gt;
          &lt;module&gt;capcha-solver&lt;/module&gt;
      &lt;/modules&gt;
  
      &lt;build&gt;
          &lt;pluginManagement&gt;
              &lt;plugins&gt;
                  &lt;!-- All project will be interpreted (source) and compiled (target) in java 7 --&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                      &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                      &lt;configuration&gt;
                          &lt;source&gt;1.7&lt;/source&gt;
                          &lt;target&gt;1.7&lt;/target&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
                  &lt;!-- this will make eclipse:eclipse goal work and make the project Eclipse compatible --&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                      &lt;artifactId&gt;maven-eclipse-plugin&lt;/artifactId&gt;
                      &lt;version&gt;2.5.1&lt;/version&gt;
                      &lt;configuration&gt;
                          &lt;downloadSources&gt;true&lt;/downloadSources&gt;
                          &lt;downloadJavadocs&gt;true&lt;/downloadJavadocs&gt;
                          &lt;classpathContainers&gt;
                              &lt;classpathContainer&gt;org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7&lt;/classpathContainer&gt;
                          &lt;/classpathContainers&gt;
                          &lt;additionalBuildcommands&gt;
                              &lt;buildcommand&gt;net.sf.eclipsecs.core.CheckstyleBuilder&lt;/buildcommand&gt;
                          &lt;/additionalBuildcommands&gt;
                          &lt;additionalProjectnatures&gt;
                              &lt;projectnature&gt;net.sf.eclipsecs.core.CheckstyleNature&lt;/projectnature&gt;
                          &lt;/additionalProjectnatures&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
              &lt;/plugins&gt;
          &lt;/pluginManagement&gt;
      &lt;/build&gt;
  
      &lt;!-- All child pom will inherit those dependancies --&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.12&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>and here is my child pom</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;parent&gt;
          &lt;groupId&gt;fr.mssb.ongoing&lt;/groupId&gt;
          &lt;artifactId&gt;ongoing-parent&lt;/artifactId&gt;
          &lt;version&gt;1.0&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;groupId&gt;fr.mssb.ongoing&lt;/groupId&gt;
      &lt;artifactId&gt;capcha-solver&lt;/artifactId&gt;
      &lt;version&gt;1.0&lt;/version&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt; &lt;!-- I think this is useless --&gt;
  
      &lt;name&gt;A capcha solver based on terassec ocr&lt;/name&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;!-- autorun unit tests during maven compilation --&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                      &lt;argLine&gt;-Xmx1024m -XX:MaxPermSize=256m -XX:-UseSplitVerifier&lt;/argLine&gt;
                      &lt;skipTests&gt;-DskipTests&lt;/skipTests&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  
              &lt;!--  this should make the tesseract ocr native dll work without doing anything --&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;com.googlecode.mavennatives&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-nativedependencies-plugin&lt;/artifactId&gt;
                  &lt;version&gt;0.0.7&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;unpacknatives&lt;/id&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;copy&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
      &lt;dependencies&gt;
          &lt;!-- 
          Log4j 2 is broken up in an API and an implementation (core), where the API 
          provides the interface that applications should code to. Strictly speaking 
          Log4j core is only needed at runtime and not at compile time.
          However, below we list Log4j core as a compile time dependency to improve 
          the startup time for custom plugins. 
          --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j-api&lt;/artifactId&gt;
              &lt;version&gt;2.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j-core&lt;/artifactId&gt;
              &lt;version&gt;2.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!--
          Integration of tesseract OCR
          --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;net.sourceforge.tess4j&lt;/groupId&gt;
              &lt;artifactId&gt;tess4j&lt;/artifactId&gt;
              &lt;version&gt;1.4.1&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>and of course, the code (taken from tess4j example)</p>
  
  <pre><code>package test;
  
  import java.io.File;
  
  import net.sourceforge.tess4j.Tesseract;
  import net.sourceforge.tess4j.TesseractException;
  
  /**
   * Classe d'exemple.
   */
  public class TesseractExample {
  
      public static void main(String[] args) {
          File imageFile = new File("C:\\DEV\\repo\\ongoing\\capcha-solver\\src\\test\\resources\\random.jpg");
          Tesseract instance = Tesseract.getInstance();  // JNA Interface Mapping
          // Tesseract1 instance = new Tesseract1(); // JNA Direct Mapping
  
          try {
              String result = instance.doOCR(imageFile);
              System.out.println(result);
          } catch (TesseractException e) {
              System.err.println(e.getMessage());
          }
      }
  }
  </code></pre>
  
  <p>When I lauch it I'm getting this exception</p>
  
  <pre><code>Exception in thread "main" java.lang.NoSuchFieldError: RESOURCE_PREFIX
      at net.sourceforge.tess4j.util.LoadLibs.&lt;clinit&gt;(LoadLibs.java:60)
      at net.sourceforge.tess4j.TessAPI.&lt;clinit&gt;(TessAPI.java:40)
      at net.sourceforge.tess4j.Tesseract.init(Tesseract.java:303)
      at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:239)
      at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:188)
      at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:172)
      at test.TesseractExample.main(TesseractExample.java:19)
  </code></pre>
  
  <p>I don't know if this is tess4j related or a JNA/JNI problem, as you can see I have a plugin that "should" (never worked with DLLs before) make them work.</p>
  
  <p>Also in the parent pom my plugin are betwen plugin managment tags, I think I should have put them betwen build tags, no?</p>
  
  <p>Any idea?</p>
  
  <p>Thanks.</p>