<?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>
	<parent>
		<groupId>com.hcl.domino</groupId>
		<artifactId>domino-jnx</artifactId>
		<version>1.20.0</version>
		<relativePath>../..</relativePath>
	</parent>
	<artifactId>jnx-example-graalvm-native</artifactId>
	<name>HCL Domino API Example GraalVM Native App</name>

	<properties>
		<graal.version>22.3.0</graal.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>domino-jnx-api</artifactId>
			<version>${project.version}</version>
		</dependency>
		<!-- Implementation dependency must be present here and not in a profile, or it won't be included in the native image -->
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>domino-jnx-jna</artifactId>
			<version>${project.version}</version>
		</dependency>

		<dependency>
			<groupId>org.graalvm.nativeimage</groupId>
			<artifactId>svm</artifactId>
			<version>${graal.version}</version>
			<scope>provided</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>

				<executions>
					<execution>
						<id>bundle-manifest</id>
						<phase>process-classes</phase>
						<goals>
							<goal>manifest</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-deploy-plugin</artifactId>
				<configuration>
					<skip>true</skip>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<configuration>
					<skip>false</skip>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>native-image</id>

			<build>
				<plugins>
					<plugin>
						<groupId>org.graalvm.buildtools</groupId>
						<artifactId>native-maven-plugin</artifactId>
						<version>0.9.9</version>
						<configuration>
							<imageName>${project.artifactId}</imageName>
							<mainClass>com.hcl.domino.example.graalvm.Main</mainClass>
						</configuration>
						<executions>
							<execution>
								<goals>
									<goal>build</goal>
								</goals>
								<phase>package</phase>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>