<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>co.codewizards.cloudstore.server</artifactId>

	<parent>
		<groupId>co.codewizards.cloudstore</groupId>
		<artifactId>co.codewizards.cloudstore.parent</artifactId>
		<version>1.0.1-SNAPSHOT</version>
		<relativePath>../co.codewizards.cloudstore.parent</relativePath>
	</parent>

	<dependencies>
		<dependency>
<!--
This dependency is AFAIK not *yet* needed. However, in the future, the server should
be able to sync its repositories with other servers, too. Then, it needs the REST-client.
Until then, this dependency does not hurt, either, because we package the entire client,
anyway - see below.
-->
			<groupId>co.codewizards.cloudstore</groupId>
			<artifactId>co.codewizards.cloudstore.rest.client</artifactId>
		</dependency>
		<dependency>
			<groupId>co.codewizards.cloudstore</groupId>
			<artifactId>co.codewizards.cloudstore.rest.server</artifactId>
		</dependency>

		<dependency>
			<groupId>co.codewizards.cloudstore</groupId>
			<artifactId>co.codewizards.cloudstore.ls.server</artifactId>
		</dependency>

		<dependency> <!-- We package the entire client into the server, because it's needed for administration (=> CLI) anyway and does not significantly increase the size. -->
			<groupId>co.codewizards.cloudstore</groupId>
			<artifactId>co.codewizards.cloudstore.client</artifactId>
		</dependency>

		<dependency>
			<groupId>org.glassfish.jersey.containers</groupId>
			<artifactId>jersey-container-servlet</artifactId>
		</dependency>

		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-server</artifactId>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-servlets</artifactId>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-webapp</artifactId>
		</dependency>

		<!-- BEGIN logging -->
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>jul-to-slf4j</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>jcl-over-slf4j</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>log4j-over-slf4j</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<scope>compile</scope>
		</dependency>
		<!-- END logging -->
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<archive>
						<manifest>
							<mainClass>co.codewizards.cloudstore.server.CloudStoreServer</mainClass>
							<addClasspath>true</addClasspath>
						</manifest>
					</archive>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-dependencies</id>
						<phase>package</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<configuration>
							<includeScope>runtime</includeScope>
						</configuration>
					</execution>
					<execution>
						<id>unpack-client</id>
						<phase>package</phase>
						<goals>
							<goal>unpack</goal>
						</goals>
						<configuration>
							<artifactItems>
								<artifactItem>
									<groupId>co.codewizards.cloudstore</groupId>
									<artifactId>co.codewizards.cloudstore.client</artifactId>
									<version>${project.version}</version>
									<type>tar.gz</type>
									<classifier>bin</classifier>
									<overWrite>true</overWrite>
									<outputDirectory>${project.build.directory}/co.codewizards.cloudstore.client</outputDirectory>
								</artifactItem>
							</artifactItems>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<configuration>
					<descriptors>
						<descriptor>src/assembly/bin.xml</descriptor>
					</descriptors>
				</configuration>
				<executions>
					<execution>
						<id>make-assembly</id> <!-- this is used for inheritance merges -->
						<phase>package</phase> <!-- bind to the packaging phase -->
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>