I compiled openCV and OpenCV_contrib library and had the resulting build/bin/opencv-411.jar
and libraries .so in build/lib/
. Now I am wondering how can I add these to my Maven project?
I was using that Maven repository but the contrib modules are not available.
I tried including the jar as a dependency like here with:
<dependency>
<groupId>org.opencv</groupId>
<artifactId>opencv-411</artifactId>
<version>4.1.0</version>
<scope>system</scope>
<systemPath>${resourcesfolder}/opencv-411.jar</systemPath>
</dependency>
I get no error when I launch clean javafx:compile
but when I launch clean javafx:run
a lot of OpenCV errors appear :
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/.../src/main/java/model/VideoModel.java:[3,23] package org.opencv.core does not exist
[ERROR] /home/.../src/main/java/model/VideoModel.java:[4,23] package org.opencv.core does not exist
[ERROR] /home/.../src/main/java/model/VideoModel.java:[5,26] package org.opencv.videoio does not exist
[ERROR] /home/.../src/main/java/model/VideoModel.java:[6,26] package org.opencv.videoio does not exist
[ERROR] /home/.../src/main/java/model/VideoModel.java:[25,17] cannot find symbol
symbol: class VideoCapture
location: class model.VideoModel
[ERROR] /home/.../src/main/java/model/VideoModel.java:[26,17] cannot find symbol
symbol: class Mat
I also had a look to that but he deployed his new jar containing the executables and libraries in a remote repository. The interesting part is the jar creation, so I tried to do the same with opencv-411.jar
and lib/
folder with:
cp opencv-411.jar opencv-411-new.jar
jar -uvf opencv-411-new.jar lib/
and kept the dependency as above, but raised the same errors...
What should I do?