<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<packaging>bundle</packaging>
	<groupId>io.github.julienmerconsulting.apertix</groupId>
	<artifactId>opencv</artifactId>
	<version>4.10.0-0</version>
	<name>OpenPnP OpenCV</name>
	<description>OpenCV packaged with native libraries and loader for multiple platforms.</description>
	<url>http://github.com/openpnp/opencv</url>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<opencv.version.long>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}</opencv.version.long>
		<opencv.version.short>${parsedVersion.majorVersion}${parsedVersion.minorVersion}${parsedVersion.incrementalVersion}</opencv.version.short>
	</properties>

	<profiles>
		<profile>
			<id>jdk-8</id>
			<activation>
				<jdk>1.8</jdk>
			</activation>
			<properties>
				<javadoc.parameters>-Xdoclint:none</javadoc.parameters>
			</properties>
		</profile>

		<profile>
			<id>release</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.sonatype.central</groupId>
						<artifactId>central-publishing-maven-plugin</artifactId>
						<version>0.9.0</version>
						<extensions>true</extensions>
						<configuration>
							<publishingServerId>central</publishingServerId>
							<tokenAuth>true</tokenAuth>
							<autoPublish>true</autoPublish>
							<waitUntil>published</waitUntil>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>3.2.8</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
								<configuration>
									<gpgArguments>
										<arg>--pinentry-mode</arg>
										<arg>loopback</arg>
									</gpgArguments>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<licenses>
		<license>
			<name>BSD License</name>
			<url>http://github.com/Itseez/opencv/raw/master/LICENSE</url>
		</license>
	</licenses>

	<scm>
		<url>http://github.com/openpnp/opencv</url>
		<connection>scm:git:http://github.com/openpnp/opencv.git</connection>
		<developerConnection>scm:git:http://github.com/openpnp/opencv.git</developerConnection>
		<tag>v3.2.0-1</tag>
	</scm>

	<issueManagement>
		<system>GitHub</system>
		<url>http://github.com/openpnp/opencv/issues</url>
	</issueManagement>

	<developers>
		<developer>
			<id>vonnieda</id>
			<name>Jason von Nieda</name>
			<email>jason@vonnieda.org</email>
			<organization>OpenPnP</organization>
			<organizationUrl>http://openpnp.org</organizationUrl>
			<roles>
				<role>maintainer</role>
			</roles>
		</developer>
		<developer>
			<id>michaelahlers</id>
			<name>Michael Ahlers</name>
			<email>michael.ahlers@pattern.nu</email>
			<organization>Pattern</organization>
			<organizationUrl>http://pattern.nu</organizationUrl>
			<roles>
				<role>maintainer</role>
			</roles>
		</developer>
	</developers>

	<distributionManagement>
		<snapshotRepository>
			<id>ossrh</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
	</distributionManagement>

	<build>
		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>3.6.1</version>
				<executions>
					<execution>
						<id>parse-version</id>
						<goals>
							<goal>parse-version</goal>
						</goals>
					</execution>
					<execution>
						<id>add-upstream-sources</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>add-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>${project.build.directory}/upstream-sources</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<extensions>true</extensions>
				<configuration>
					<instructions>
						<Export-Package>nu.pattern.*, org.opencv.*</Export-Package>
						<Import-Package>!sun.reflect.*</Import-Package>
					</instructions>
				</configuration>
			</plugin>

			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.14.0</version>
				<configuration>
					<source>17</source>
					<target>17</target>
				</configuration>
			</plugin>

			<plugin>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>3.2.0</version>
				<executions>
					<execution>
						<phase>generate-sources</phase>
						<configuration>
							<target>
								<echo>Extracting Java classes.</echo>
								<unjar src="${project.basedir}/upstream/opencv-${opencv.version.short}.jar"
									dest="${project.build.directory}/classes">
									<patternset>
										<include name="**/*.class" />
									</patternset>
								</unjar>
								<echo>Extracting Java sources.</echo>
								<unjar src="${project.basedir}/upstream/opencv-${opencv.version.short}.jar"
									dest="${project.build.directory}/upstream-sources">
									<patternset>
										<include name="**/*.java" />
									</patternset>
								</unjar>
							</target>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>3.4.0</version>
				<executions>
					<execution>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>3.5.5</version>
				<configuration>
					<systemProperties>
						<property>
							<name>java.util.logging.config.file</name>
							<value>${project.build.directory}/test-classes/logging.properties</value>
						</property>
					</systemProperties>
					<properties>
						<property>
							<name>listener</name>
							<value>nu.pattern.LoadLibraryRunListener</value>
						</property>
					</properties>
					<workingDirectory>${project.basedir}/upstream</workingDirectory>
					<excludes>
						<exclude>**/OpenCVTestCase.*</exclude>
					</excludes>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>3.12.0</version>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<failOnError>false</failOnError>
					<additionalparam>${javadoc.parameters}</additionalparam>
				</configuration>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>org.apache.maven.plugins</groupId>
										<artifactId>maven-antrun-plugin</artifactId>
										<versionRange>[3.2.0,)</versionRange>
										<goals>
											<goal>run</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore></ignore>
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<dependencies>
		<dependency>
			<groupId>net.java.dev.jna</groupId>
			<artifactId>jna</artifactId>
			<version>5.14.0</version>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.13.2</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
</project>
