<?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/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>org.eclipse.rdf4j</groupId>
		<artifactId>rdf4j-tools</artifactId>
		<version>3.7.4</version>
	</parent>
	<artifactId>rdf4j-runtime-osgi</artifactId>
	<packaging>bundle</packaging>
	<name>RDF4J: Runtime - OSGi</name>
	<description>OSGi Runtime dependencies for an RDF4J application</description>
	<properties>
		<serviceresources.basedir>${project.build.directory}/serviceResources</serviceresources.basedir>
		<serviceresources.raw.dir>${serviceresources.basedir}/raw</serviceresources.raw.dir>
		<serviceresources.raw.jar>${serviceresources.raw.dir}/raw-service-resources.jar</serviceresources.raw.jar>
		<serviceresources.fixed.dir>${serviceresources.basedir}/fixed</serviceresources.fixed.dir>
		<jarToEnhance>${project.build.directory}/${project.artifactId}-${project.version}.jar</jarToEnhance>
	</properties>
	<dependencies>
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>rdf4j-http-server-spring</artifactId>
			<version>${project.version}</version>
		</dependency>
	</dependencies>
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<extensions>true</extensions>
				<configuration>
					<remoteOBR>NONE</remoteOBR>
					<instructions>
						<Bundle-SymbolicName>org.eclipse.rdf4j</Bundle-SymbolicName>
						<Export-Package>!*text-base,!*prop-base,org.eclipse.rdf4j.*</Export-Package>
						<Import-Package>org.slf4j.*, javax.*;resolution:=optional, org.apache.*;resolution:=optional, org.springframework.*;resolution:=optional, org.locationtech;resolution:=optional, org.elasticsearch;resolution:=optional, ch.qos.logback;resolution:=optional, *</Import-Package>
						<Embed-Dependency>*; groupId=org.eclipse.rdf4j; scope=compile|runtime; type=!pom; inline=true</Embed-Dependency>
						<Embed-Transitive>true</Embed-Transitive>
					</instructions>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<executions>
					<execution>
						<id>gather-provider-configuration-files</id>
						<goals>
							<goal>shade</goal>
						</goals>
						<configuration>
							<artifactSet>
								<includes>
									<include>${project.groupId}:*:*</include>
								</includes>
							</artifactSet>
							<filters>
								<filter>
									<artifact>*</artifact>
									<includes>
										<include>META-INF/services/*</include>
									</includes>
								</filter>
							</filters>
							<transformers>
								<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
							</transformers>
							<outputFile>${serviceresources.raw.jar}</outputFile>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-antrun-plugin</artifactId>
				<executions>
					<execution>
						<phase>package</phase>
						<id>enrich-main-artifact-with-provider-configuration-files</id>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<target>
								<ant antfile="build.xml" target="enrich-artifact-with-provider-configuration-files" dir="${basedir}"/>
							</target>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
