title: How to import OpenCV in the Maven project?
body: <p>I made opencv dependency tag in the pom.xml like the following.</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.opencv&lt;/groupId&gt;
          &lt;artifactId&gt;opencv&lt;/artifactId&gt;
          &lt;version&gt;3.4.8&lt;/version&gt;
          &lt;scope&gt;system&lt;/scope&gt;
          &lt;systemPath&gt;${project.lib.path}/opencv-348.jar&lt;/systemPath&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>And I added "private static" method in Java file like the following.</p>
  
  <pre><code>private static boolean _Initialized() {
      try {
          String libname = "C:/Windows/System32/opencv_java348.dll";
          System.load(libname);
          return true;
      } catch(Exception e) {
          log.warn(e.getMessage());
          return false;
      }
  }
  </code></pre>
  
  <p>And then I added "public static" method like the following.</p>
  
  <pre><code>public static Boolean test() {
      if (_Initialized()) {
          log.info("CV*************" + _Initialized());
          log.info("CV*************" + Core.getVersionString());
      }
  }
  </code></pre>
  
  <p>At last I made "GetMapping" method like the following.</p>
  
  <pre><code>@GetMapping("/opencv")
  public ResponseEntity&lt;?&gt; getTestResult() {
      return ResponseEntity.ok(OpenCVTest.test());
  }
  </code></pre>
  
  <p>When I called API uri "/opencv", I got one success and one error like the following.</p>
  
  <pre><code>2019-12-02 19:09:13.516  INFO 6452 --- [ XNIO-1 task-28]  : CV*************true
  2019-12-02 19:09:13.536 ERROR 6452 --- [ XNIO-1 task-28] : Internal Server Error
  
  org.springframework.web.util.NestedServletException: Handler dispatch failed; 
  nested exception is java.lang.UnsatisfiedLinkError: 
         org.opencv.core.Core.getVersionString_0()Ljava/lang/String;
  </code></pre>
  
  <p>For another test without maven, I made "main" method in the OpenCVTest.java like the following.</p>
  
  <pre><code>public static void main(String[] args){
      if (_Initialized()) {
          log.info("CV*************"+ _Initialized());
          log.info("CV*************"+ Core.getVersionString());
      }
  }
  </code></pre>
  
  <p>And then I ran the "main" method in the java independently apart from maven.
  I got both of success like the following.</p>
  
  <pre><code>18:56:04.530 [main] INFO - CV*************true
  18:56:04.537 [main] INFO - CV*************3.4.8
  </code></pre>
  
  <p>In a nutshell, <em>System.load(native dll)</em> always operates <strong>successfully via the both ways</strong>.</p>
  
  <p>But <em>Calling native methods</em> of opencv.core.Core.* <strong>fails only in the Maven project</strong>.</p>
  
  <p>Help me solve this problem, please.
  Thank you all.</p>