<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>de.mklinger.qetcher</groupId>
		<artifactId>qetcher-clients</artifactId>
		<version>2.0.2</version>
	</parent>
	<artifactId>qetcher-client-bundle</artifactId>
	<packaging>bundle</packaging>

	<name>${project.artifactId}</name>
	<description>Qetcher Java client, OSGi bundle, minimal dependencies</description>

	<dependencies>
		<dependency>
			<groupId>de.mklinger.qetcher</groupId>
			<artifactId>qetcher-client-nodeps</artifactId>
			<version>${project.version}</version>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.felix</groupId>
			<artifactId>org.apache.felix.main</artifactId>
			<version>6.0.2</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.ow2.asm</groupId>
			<artifactId>asm-all</artifactId>
			<version>5.0.4</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.aries</groupId>
			<artifactId>org.apache.aries.util</artifactId>
			<version>1.1.3</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.aries.spifly</groupId>
			<artifactId>org.apache.aries.spifly.dynamic.bundle</artifactId>
			<version>1.2.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-simple</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<configuration>
					<instructions>
						<Bundle-Name>Qetcher Client</Bundle-Name>
						<Bundle-SymbolicName>de.mklinger.qetcher.client</Bundle-SymbolicName>
						<Export-Package>
							de.mklinger.qetcher.client.httpclient,
							de.mklinger.qetch.client,
							de.mklinger.qetch.client.model.v1,
							de.mklinger.qetch.client.common,
							de.mklinger.qetch.client.common.concurrent
						</Export-Package>
						<Import-Package>
							!de.mklinger.qetcher.client.deps.jetty.jmx,
							!javax.servlet.*,
							!javax.imageio.*,
							!javax.naming.*,
							!javax.xml.*,
							!org.w3c.*,
							!org.xml.*,
							!sun.*,
							*
						</Import-Package>
						<Embed-Dependency>
							qetcher-client-nodeps;inline=true
						</Embed-Dependency>
						<Require-Capability>
							osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)",
							osgi.extender; filter:="(osgi.extender=osgi.serviceloader.processor)"
						</Require-Capability>
						<!--
						Seems not to be needed:
						
						Require-Capability:
						osgi.serviceloader; filter:="(osgi.serviceloader=de.mklinger.qetcher.client.deps.jetty.io.ssl.ALPNProcessor$Client)";cardinality:=multiple,
						
						Provide-Capability:
						osgi.serviceloader; osgi.serviceloader=de.mklinger.qetcher.client.deps.jetty.io.ssl.ALPNProcessor$Client
						 -->
					</instructions>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<executions>
					<execution>
						<goals>
							<goal>integration-test</goal>
							<goal>verify</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<runOrder>random</runOrder>
					<redirectTestOutputToFile>false</redirectTestOutputToFile>
					<trimStackTrace>false</trimStackTrace>
					<systemProperties>
						<bundle.file>${project.build.directory}/${project.build.finalName}.jar</bundle.file>
					</systemProperties>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<!-- ossrh release -->
			<!-- copy sources and javadoc from qetcher-client and attach it to this project -->
			<id>release</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-dependency-plugin</artifactId>
						<executions>
							<execution>
								<id>copy</id>
								<phase>package</phase>
								<goals>
									<goal>copy</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<artifactItems>
								<artifactItem>
									<groupId>de.mklinger.qetcher</groupId>
									<artifactId>qetcher-client</artifactId>
									<classifier>sources</classifier>
									<version>${project.version}</version>
									<type>jar</type>
									<destFileName>qetcher-client-sources.jar</destFileName>
								</artifactItem>
								<artifactItem>
									<groupId>de.mklinger.qetcher</groupId>
									<artifactId>qetcher-client</artifactId>
									<classifier>javadoc</classifier>
									<version>${project.version}</version>
									<type>jar</type>
									<destFileName>qetcher-client-javadoc.jar</destFileName>
								</artifactItem>
							</artifactItems>
							<outputDirectory>${project.build.directory}</outputDirectory>
							<overWriteReleases>true</overWriteReleases>
							<overWriteSnapshots>true</overWriteSnapshots>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>build-helper-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>attach-artifacts</id>
								<phase>package</phase>
								<goals>
									<goal>attach-artifact</goal>
								</goals>
								<configuration>
									<artifacts>
										<artifact>
											<file>${project.build.directory}/qetcher-client-sources.jar</file>
											<type>jar</type>
											<classifier>sources</classifier>
										</artifact>
										<artifact>
											<file>${project.build.directory}/qetcher-client-javadoc.jar</file>
											<type>jar</type>
											<classifier>javadoc</classifier>
										</artifact>
									</artifacts>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>