<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>

	<artifactId>jackson-jq</artifactId>
	<name>${project.groupId}:${project.artifactId}</name>
	<packaging>bundle</packaging>

	<parent>
		<groupId>net.thisptr</groupId>
		<artifactId>jackson-jq-parent</artifactId>
		<version>1.6.0</version>
	</parent>

	<dependencies>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-annotations</artifactId>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
		</dependency>
		<dependency>
			<groupId>org.jruby.joni</groupId>
			<artifactId>joni</artifactId>
			<version>2.2.6</version>
		</dependency>
		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
			<version>33.4.8-jre</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.dataformat</groupId>
			<artifactId>jackson-dataformat-yaml</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.rocksdb</groupId>
			<artifactId>rocksdbjni</artifactId>
			<version>7.10.2</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<profiles>
		<profile>
			<id>native</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.graalvm.buildtools</groupId>
						<artifactId>native-maven-plugin</artifactId>
						<version>0.11.0</version>
						<extensions>true</extensions>
						<executions>
							<execution>
								<id>test-native</id>
								<goals>
									<goal>generateTestResourceConfig</goal>
									<goal>test</goal>
								</goals>
								<phase>test</phase>
								<configuration>
									<resourceIncludedPatterns>
										<pattern>classpath_modules(/.*\.(jq|json))?</pattern>
										<pattern>tests(/.*\.ya?ml)?</pattern>
										<pattern>failing_tests(/.*\.ya?ml)?</pattern>
										<pattern>jq-test-extra-ok.json</pattern>
										<pattern>librocksdbjni-.*.(so|jnilib|dll)</pattern>
									</resourceIncludedPatterns>
								</configuration>
							</execution>
						</executions>
						<configuration>
							<fallback>false</fallback>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<build>
		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>javacc-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>javacc</id>
						<goals>
							<goal>javacc</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<configuration>
					<excludePackageNames>net.thisptr.jackson.jq.internal.javacc</excludePackageNames>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<configuration>
					<instructions>
						<Include-Resource>
							META-INF/services/net.thisptr.jackson.jq.Function=${project.build.outputDirectory}/META-INF/services/net.thisptr.jackson.jq.Function,
							META-INF/jandex.idx=${project.build.outputDirectory}/META-INF/jandex.idx,
							META-INF/native-image/resource-config.json=${project.build.outputDirectory}/META-INF/native-image/resource-config.json,
							META-INF/native-image/reflect-config.json=${project.build.outputDirectory}/META-INF/native-image/reflect-config.json,
							META-INF/native-image/native-image.properties=${project.build.outputDirectory}/META-INF/native-image/native-image.properties
						</Include-Resource>
					</instructions>
					<archive>
						<manifestEntries>
							<Automatic-Module-Name>net.thisptr.jackson.jq</Automatic-Module-Name>
						</manifestEntries>
					</archive>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.jboss.jandex</groupId>
				<artifactId>jandex-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>make-index</id>
						<goals>
							<goal>jandex</goal>
						</goals>
						<configuration>
							<verbose>true</verbose>
							<processDefaultFileSet>false</processDefaultFileSet>
							<fileSets>
								<fileSet>
									<directory>${project.build.outputDirectory}</directory>
									<includes>
										<include>net/thisptr/jackson/jq/internal/filters/**/*.class</include>
										<include>net/thisptr/jackson/jq/internal/functions/**/*.class</include>
										<include>net/thisptr/jackson/jq/BuiltinFunction.class</include>
										<include>net/thisptr/jackson/jq/Function.class</include>
									</includes>
									<excludes>
										<exclude>net/thisptr/jackson/jq/internal/functions/EnvFunction.class</exclude>
									</excludes>
								</fileSet>
							</fileSets>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
