<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>
		<artifactId>maven-parent</artifactId>
		<groupId>org.gcube.tools</groupId>
		<version>1.0.0</version>
		<relativePath />
	</parent>
	<groupId>org.gcube.data.transfer</groupId>
	<version>2.0.0-3.3.0</version>
	<artifactId>agent-library</artifactId>
	<name>The Data Transfer Agent Library</name>

	<properties>
		<distroDirectory>distro</distroDirectory>
	</properties>


	<dependencies>
		<dependency>
			<groupId>org.gcube.data.transfer</groupId>
			<artifactId>common</artifactId>
			<version>2.0.0-3.3.0</version>
		</dependency>

		<dependency>
			<groupId>org.gcube.execution</groupId>
			<artifactId>grs2library</artifactId>
			<version>2.1.1-3.3.0</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.gcube.core</groupId>
			<artifactId>common-fw-clients</artifactId>
			<version>1.1.0-3.3.0</version>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.10</version><!--$NO-MVN-MAN-VER$ -->
			<scope>test</scope>
		</dependency>
		
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-log4j12</artifactId>
			<version>1.6.4</version>
			<scope>test</scope>
		</dependency>
		<!-- runtime -->
		<dependency>
			<groupId>org.gcube.tools</groupId>
			<artifactId>my-container</artifactId>
			<version>2.0.0-3.3.0</version>
			<scope>test</scope>
			<exclusions>
				<exclusion>
					<groupId>org.gcube.core</groupId>
 					<artifactId>gcf</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<!-- distro -->
		<dependency>
			<groupId>org.gcube.tools</groupId>
			<artifactId>my-container</artifactId>
			<version>2.0.0-3.3.0</version>
			<type>tar.gz</type>
			<classifier>distro</classifier>
			<scope>test</scope>
			<exclusions>
				<exclusion>
					<groupId>org.gcube.core</groupId>
 					<artifactId>gcf</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>org.gcube.data.transfer</groupId>
			<artifactId>agent-service</artifactId>
			<version>2.1.0-3.3.0</version>
			<type>gar</type>
			<scope>test</scope>
		</dependency>
	</dependencies>
	<build>

		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<configuration>
					<descriptors>
						<descriptor>${distroDirectory}/descriptor.xml</descriptor>
					</descriptors>
				</configuration>
				<executions>
					<execution>
						<id>servicearchive</id>
						<phase>install</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<version>2.5</version>
				<executions>
					<execution>
						<id>copy-profile</id>
						<phase>install</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>target</outputDirectory>
							<resources>
								<resource>
									<directory>${distroDirectory}</directory>
									<filtering>true</filtering>
									<includes>
										<include>profile.xml</include>
									</includes>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<version>2.4</version>
				<executions>
					<execution>
						<id>install-my-container</id>
						<phase>generate-test-resources</phase><!-- runs before tests -->
						<configuration>
							<includeArtifactIds>my-container</includeArtifactIds>
							<includeTypes>tar.gz</includeTypes>
							<overWriteIfNewer>false</overWriteIfNewer>
							<outputDirectory>${project.basedir}</outputDirectory>
							<markersDirectory>${project.basedir}</markersDirectory>
						</configuration>
						<goals>
							<goal>unpack-dependencies</goal>
						</goals>
					</execution>
					<execution>
						<id>install-agent</id>
						<phase>generate-test-resources</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<configuration>
							<includeArtifactIds>agent-service</includeArtifactIds>
							<overWriteSnapshots>true</overWriteSnapshots>
							<includeTypes>gar</includeTypes>
							<excludeTransitive>false</excludeTransitive>
							<outputDirectory>src/test/resources</outputDirectory>
							<stripVersion>true</stripVersion>
						</configuration>
					</execution>
				</executions>
			</plugin>

		</plugins>

		<pluginManagement>
			<plugins>
				<!--This plugin's configuration is used to store Eclipse m2e settings 
					only. It has no influence on the Maven build itself. -->
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.apache.maven.plugins
										</groupId>
										<artifactId>
											maven-dependency-plugin
										</artifactId>
										<versionRange>
											[2.4,)
										</versionRange>
										<goals>
											<goal>
												unpack-dependencies
											</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore></ignore>
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<profiles>
		<profile>
			<id>local-deploy</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.gcube.tools</groupId>
						<artifactId>maven-service-plugin</artifactId>
						<executions>
							<execution>
								<phase>package</phase>
								<goals>
									<goal>local-deploy</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

</project>