<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>
	<name>Li2b2 SHRINE : Server : Standalone Broker (i2b2)</name>
	<packaging>jar</packaging>

	<description>
	Standalone service to to run the AKTIN broker and aggregator
	together with an i2b2 query frontend.
	</description>

	<groupId>de.li2b2.shrine</groupId>
	<artifactId>i2b2-shrine</artifactId>
	<version>0.2</version>

	<parent>
		<groupId>de.li2b2.shrine</groupId>
		<artifactId>server-pom</artifactId>
		<version>0.2</version>
	</parent>
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<version>2.10</version>
				<executions>
					<execution>
						<id>copy-dependencies</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/lib</outputDirectory>
							<overWriteReleases>false</overWriteReleases>
							<overWriteSnapshots>false</overWriteSnapshots>
							<overWriteIfNewer>true</overWriteIfNewer>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<archive>
						<manifest>
							<!-- <addClasspath>true</addClasspath> -->
							<!-- <classpathPrefix>lib</classpathPrefix> -->
							<mainClass>org.aktin.broker.i2b2.standalone.HttpServer</mainClass>
						</manifest>
						<manifestEntries>
							<Class-Path>lib/</Class-Path>
						</manifestEntries>
					</archive>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>webclient</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-dependency-plugin</artifactId>
						<version>2.10</version>
						<executions>
							<execution>
								<id>unpack</id>
								<phase>generate-resources</phase>
								<goals>
									<goal>unpack</goal>
								</goals>
								<configuration>
									<artifactItems>
										<!-- this is a non-standard dependency for executing jetty:run-war. 
											See README.md for instructions. -->
										<artifactItem>
											<groupId>org.i2b2</groupId>
											<artifactId>webclient</artifactId>
											<version>1.7.08</version>
											<type>zip</type>
										</artifactItem>
									</artifactItems>
									<outputDirectory>${project.build.directory}/generated-resources</outputDirectory>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
				<resources>
					<resource>
						<directory>src/main/resources</directory>
					</resource>
					<resource>
						<directory>${project.build.directory}/generated-resources</directory>
					</resource>
				</resources>
			</build>
		</profile>
	</profiles>

	<dependencies>

		<!-- dependencies for annotations provided by the container/application 
			server -->
		<dependency>
			<groupId>javax.enterprise</groupId>
			<artifactId>cdi-api</artifactId>
			<version>1.2</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>javax.ws.rs</groupId>
			<artifactId>javax.ws.rs-api</artifactId>
			<version>2.0.1</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>javax.inject</groupId>
			<artifactId>javax.inject</artifactId>
			<version>1</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>javax.annotation</groupId>
			<artifactId>javax.annotation-api</artifactId>
			<version>1.2</version>
			<scope>provided</scope>
		</dependency>
		<!-- broker API -->
		<dependency>
			<groupId>org.aktin</groupId>
			<artifactId>broker-server</artifactId>
			<version>0.2</version>
		</dependency>
		<dependency>
			<groupId>org.aktin</groupId>
			<artifactId>broker-client</artifactId>
			<version>0.2</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>de.li2b2.shrine</groupId>
			<artifactId>i2b2-broker</artifactId>
			<version>0.2</version>
		</dependency>
		<dependency>
			<groupId>de.li2b2.facade</groupId>
			<artifactId>li2b2-server</artifactId>
			<version>0.2</version>
		</dependency>

		<!-- https://mvnrepository.com/artifact/org.hsqldb/hsqldb -->
		<dependency>
			<groupId>org.hsqldb</groupId>
			<artifactId>hsqldb</artifactId>
			<version>2.3.4</version>
		</dependency>



		<!-- test dependencies to run a server for testing -->
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-server</artifactId>
			<version>9.2.14.v20151106</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-servlet</artifactId>
			<version>9.2.14.v20151106</version>
		</dependency>
		<dependency>
			<groupId>org.glassfish.jersey.core</groupId>
			<artifactId>jersey-server</artifactId>
			<version>2.23.1</version>
		</dependency>
		<dependency>
			<groupId>org.glassfish.jersey.containers</groupId>
			<artifactId>jersey-container-servlet-core</artifactId>
			<version>2.23.1</version>
		</dependency>
		<dependency>
			<groupId>org.glassfish.jersey.containers</groupId>
			<artifactId>jersey-container-jetty-http</artifactId>
			<version>2.23.1</version>
		</dependency>
		<dependency>
			<groupId>org.glassfish.jersey.ext.cdi</groupId>
			<artifactId>jersey-cdi1x-servlet</artifactId>
			<version>2.23.1</version>
		</dependency>
		<dependency>
			<groupId>org.glassfish.hk2</groupId>
			<artifactId>hk2-locator</artifactId>
			<version>2.4.0</version>
		</dependency>
		<dependency>
			<groupId>org.glassfish.hk2</groupId>
			<artifactId>hk2-core</artifactId>
			<version>2.4.0</version>
		</dependency>


		<!-- test -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>

	</dependencies>
</project>