<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>
	</parent>

	<!-- parent coordinates  -->
	<groupId>org.gcube.samples</groupId>
	<artifactId>sample-service-multi</artifactId>
	<version>1.0.0-SNAPSHOT</version>
	<packaging>pom</packaging>

	<!-- properties shared across stubs and service implementation -->
	<properties>

		<!-- module names to reuse in cross-module configuration (e.g. service profile) -->
		<serviceArtifactId>sample-service-multi-core</serviceArtifactId>
		<stubsArtifactId>sample-service-multi-stubs</stubsArtifactId>

		<namespace>http://acme.org/sample</namespace>
		
		<!-- cross-module configuration as required by service plugin -->
		
			<!-- location of pre-processed WSDLs -->
			<wsdlDirectory>${project.basedir}/../wsdl</wsdlDirectory>
			
			<!-- (temporary) location for post-processed WSDLs to include in artifacts and from which stubs are generated -->
			<wsdlOutputDirectory>${project.basedir}/../target/generated-sources/wsdl</wsdlOutputDirectory>
			
			<!-- location of service configuration -->
			<configDirectory>${project.basedir}/../config</configDirectory>
			
			<!-- location of static archive element -->
			<distroDirectory>${project.basedir}/../distro</distroDirectory>

	</properties>

	<!-- module structure -->
	<modules>
		<module>${stubsArtifactId}</module>
		<module>${serviceArtifactId}</module>
	</modules>

	<!-- source control coordinates to interpolate in svnpath -->
	<scm>
		<connection>scm:svn:http://svn.d4science.research-infrastructures.eu/gcube/trunk/samples/sample-service-maven-multi</connection>
		<developerConnection>scm:svn:https://svn.d4science.research-infrastructures.eu/gcube/trunk/samples/sample-service-maven-multi</developerConnection>
		<url>http://svn.d4science.research-infrastructures.eu/gcube/trunk/samples/sample-service-maven-multi</url>
	</scm>


	
	<!-- cross-module service dependencies -->
	<dependencies>
		<dependency>
			<groupId>org.gcube.core</groupId>
			<artifactId>gcf</artifactId>
			<version>LATEST</version> <!-- hint: replace with minor-range -->
			<scope>provided</scope>
		</dependency>
	</dependencies>


	<build>

		<!-- cross-module configuration of service plugin used in stub and service implementation -->
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.gcube.tools</groupId>
					<artifactId>maven-service-plugin</artifactId>
					<version>1.1.0</version>
					<configuration>
						<serviceId>sample-service</serviceId>
						<basePackage>org.acme.sample</basePackage>
						<wsdlDirectory>${wsdlDirectory}</wsdlDirectory>
						<wsdlOutputDirectory>${wsdlOutputDirectory}</wsdlOutputDirectory>
						<configurationDirectory>${configDirectory}</configurationDirectory>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>


		<plugins>

			<!-- interpolates profiles and copies from distribution location to configuration location, 
				 where it is need for embedding into stub artifact, gar generation, and service archive.
			-->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<version>2.6</version>
				<executions>
					<execution>
						<id>copy-profile</id>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<phase>process-resources</phase>
						<configuration>
							<outputDirectory>${configDirectory}</outputDirectory>
							<resources>
								<resource>
									<directory>${distroDirectory}</directory>
									<includes>
										<include>profile.xml</include>
									</includes>
									<filtering>true</filtering>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>

		</plugins>
	</build>

</project>