1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3 <modelVersion>4.0.0</modelVersion>
5 <groupId>org.opencv</groupId>
6 <artifactId>opencv-parent</artifactId>
7 <version>3.4.19</version>
9 <groupId>org.opencv</groupId>
10 <artifactId>opencv</artifactId>
11 <packaging>bundle</packaging>
15 <source.path>../../..</source.path>
16 <build.directory>${source.path}/build</build.directory>
17 <nativelibrary.name>libopencv_java${lib.version.string}.so</nativelibrary.name>
18 <resources.directory>${build.directory}/src</resources.directory>
21 <directory>../../../build/maven/opencv/target</directory>
22 <outputDirectory>../../../build/src</outputDirectory>
23 <sourceDirectory>../../../build/src</sourceDirectory>
26 <groupId>org.apache.maven.plugins</groupId>
27 <artifactId>maven-clean-plugin</artifactId>
28 <version>3.0.0</version>
32 <directory>${build.directory}</directory>
38 <groupId>org.codehaus.mojo</groupId>
39 <artifactId>exec-maven-plugin</artifactId>
40 <version>1.4.0</version>
43 <id>get-opencv-version</id>
44 <phase>generate-resources</phase>
49 <executable>bash</executable>
50 <workingDirectory>${project.basedir}/scripts</workingDirectory>
52 <argument>properties</argument>
53 <argument>${build.directory}</argument>
54 <argument>build.properties</argument>
59 <id>setup-environment</id>
60 <phase>validate</phase>
65 <executable>bash</executable>
66 <workingDirectory>${project.basedir}/scripts</workingDirectory>
68 <!-- Optional packages should be placed BEFORE required ones
69 in the following argument list. -->
70 <argument>deb_package_check</argument>
71 <argument>-olibpng-dev|libpng12-dev</argument>
72 <argument>-olibopenjp2-7-dev|libjasper-dev</argument>
73 <argument>-opython-dev</argument>
74 <argument>-opython-numpy</argument>
75 <argument>build-essential</argument>
76 <argument>cmake</argument>
77 <argument>git</argument>
78 <argument>libgtk2.0-dev</argument>
79 <argument>pkg-config</argument>
80 <argument>libavcodec-dev</argument>
81 <argument>libavformat-dev</argument>
82 <argument>libswscale-dev</argument>
83 <argument>libtbb2</argument>
84 <argument>libtbb-dev</argument>
85 <argument>libjpeg-dev</argument>
86 <argument>libtiff5-dev</argument>
87 <argument>libdc1394-22-dev</argument>
88 <argument>execstack</argument>
89 <argument>ant</argument>
94 <id>check-execstack</id>
95 <phase>process-classes</phase>
100 <workingDirectory>${project.basedir}/scripts</workingDirectory>
101 <executable>bash</executable>
103 <argument>execstack_check</argument>
104 <argument>${build.directory}/lib/libopencv_java${lib.version.string}.so</argument>
111 <artifactId>maven-resources-plugin</artifactId>
112 <version>3.0.2</version>
115 <id>copy-resources</id>
116 <phase>generate-resources</phase>
118 <goal>copy-resources</goal>
121 <outputDirectory>${resources.directory}</outputDirectory>
124 <directory>resources</directory>
132 <groupId>org.codehaus.mojo</groupId>
133 <artifactId>properties-maven-plugin</artifactId>
134 <version>1.0.0</version>
137 <id>set-arch-properties</id>
138 <phase>process-resources</phase>
140 <goal>read-project-properties</goal>
144 <file>${build.directory}/build.properties</file>
151 <groupId>org.apache.maven.plugins</groupId>
152 <artifactId>maven-enforcer-plugin</artifactId>
153 <version>1.4.1</version>
156 <phase>validate</phase>
164 <family>unix</family>
165 <message>This POM is written to function on UNIX family of OS.
166 More specifically it should be a Debian flavour of Linux.</message>
172 <id>enforce-environment</id>
178 <requireEnvironmentVariable>
180 <variableName>ANT_HOME</variableName>
181 <message>$ANT_HOME is not set. Build may fail.</message>
182 </requireEnvironmentVariable>
183 <requireEnvironmentVariable>
185 <variableName>JAVA_HOME</variableName>
186 <message>$JAVA_HOME is not set. Build will fail.</message>
187 </requireEnvironmentVariable>
188 <requireEnvironmentVariable>
190 <variableName>MAKEFLAGS</variableName>
191 <message>No MAKEFLAGS environment variable. Build may be slow.
192 To speed up the build you can try exporting MAKEFLAGS=-jX where X equals the number of parallel builds.</message>
193 </requireEnvironmentVariable>
198 <phase>process-resources</phase>
199 <id>check-versions-match</id>
206 <property>project.version</property>
207 <regex>${opencv.version}</regex>
208 <regexMessage>The Maven POM version ${project.version} does not match the extracted OpenCV version ${opencv.version}.
209 To correct this please execute the following Maven command from the Maven root directory:
210 mvn versions:set -DnewVersion=$(. ./opencv/scripts/functions && cd ./opencv/scripts && extract_version && echo $REPLY)</regexMessage>
218 <groupId>org.apache.felix</groupId>
219 <artifactId>maven-bundle-plugin</artifactId>
220 <version>2.3.7</version>
221 <extensions>true</extensions>
224 <Export-Package>*</Export-Package>
225 <Bundle-NativeCode>${nativelibrary.name};osname=linux;processor=${osgi.processor}</Bundle-NativeCode>
226 <Include-Resource>${build.directory}/lib/${nativelibrary.name}</Include-Resource>
228 <manifestLocation>${build.directory}/manifest</manifestLocation>
229 <niceManifest>true</niceManifest>
233 <groupId>com.googlecode.cmake-maven-project</groupId>
234 <artifactId>cmake-maven-plugin</artifactId>
235 <version>3.4.1-b2</version>
238 <phase>generate-sources</phase>
239 <id>cmake-generate</id>
241 <goal>generate</goal>
244 <sourcePath>../../..</sourcePath>
245 <targetPath>../../../build</targetPath>
246 <generator>Unix Makefiles</generator>
248 <option>-DBUILD_SHARED_LIBS:BOOL=OFF</option>
253 <phase>generate-sources</phase>
254 <id>cmake-compile</id>
259 <target>opencv_java</target>
260 <projectDirectory>../../../build</projectDirectory>
266 <groupId>org.apache.maven.plugins</groupId>
267 <artifactId>maven-surefire-plugin</artifactId>
268 <version>2.15</version>