<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/maven-v4_0_0.xsd">

	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>org.objectweb.fractal</groupId>
		<artifactId>parent</artifactId>
		<version>2.0</version>
	</parent>

	<artifactId>cecilia</artifactId>
	<name>Cecilia parent project</name>
	<version>2.0.3</version>
	<packaging>pom</packaging>

	<description>
		Cecilia is a Fractal component model implementation for the C world.
	</description>

	<licenses>
		<license>
			<name>LGPL</name>
			<!-- link to the txt version of the LGPL license to avoid embedding
				Gnu web site inside generated site -->
			<url>http://www.gnu.org/licenses/lgpl-3.0.txt</url>
		</license>
	</licenses>

	<modules>
		<module>runtime</module>
		<module>toolchain</module>
		<module>maven</module>
	</modules>

	<inceptionYear>2007</inceptionYear>

	<developers>
		<!-- TODO write developers here -->
	</developers>

	<contributors>
		<!-- TODO write contributors here -->
	</contributors>

	<properties>
		<cecilia.home.url>http://fractal.objectweb.org/cecilia-site/${project.version}</cecilia.home.url>
		<cecilia-examples.home.url>http://fractal.objectweb.org/cecilia-examples-site/current</cecilia-examples.home.url>
		<!-- The login name on the OW2 forge.  -->
		<ow.username>${user.name}</ow.username>
		<ow.hostname>forge.objectweb.org</ow.hostname>
		<ow.file.deploy.dir>incoming</ow.file.deploy.dir>
		<ow.site.deploy.dir>/var/lib/gforge/chroot/home/groups/fractal/htdocs/cecilia-site</ow.site.deploy.dir>
		<deploy.site.url>scp://${ow.hostname}${ow.site.deploy.dir}/${project.version}</deploy.site.url>
		<bootstrap.plugin.version>1.1</bootstrap.plugin.version>
	</properties>

	<!-- Cecilia home page -->
	<!-- Because of a bug in the maven-site-plugin, the URL of the project MUST 
		ends with a '/' which is not the case when using the basic maven
		inheritance mechanism -->
	<url>${cecilia.home.url}/</url>

	<scm>
		<connection>scm:svn:svn://svn.forge.objectweb.org/svnroot/fractal/tags/cecilia-2.0.3</connection>
		<developerConnection>scm:svn:svn+ssh://svn.forge.objectweb.org/svnroot/fractal/tags/cecilia-2.0.3</developerConnection>
		<url>http://svn.forge.objectweb.org/cgi-bin/viewcvs.cgi/fractal/tags/cecilia-2.0.3</url>
	</scm>

	<distributionManagement>
		<site>
			<id>objectweb-site</id>
			<name>ObjectWeb's site deployment</name>
			<url>${deploy.site.url}</url>
		</site>
	</distributionManagement>

	<ciManagement>
  		<system>bamboo</system>
  		<url>http://forge.ow2.org/bamboo/browse/FRACTAL-CEC</url>
  	</ciManagement>

	<build>
		<plugins>
			<!-- Force version of maven-site-plugin to 2.0-beta-5 since 
				2.0-beta-6 has many bugs in relative path management. -->
			<plugin>
				<artifactId>maven-site-plugin</artifactId>
				<version>2.0-beta-5</version>
			</plugin>

			<!-- Configure the tagBase property of the release plugin -->
			<plugin>
				<artifactId>maven-release-plugin</artifactId>
				<version>2.0-beta-7</version>
				<configuration>
					<tagBase>
						svn+ssh://svn.forge.objectweb.org/svnroot/fractal/tags
					</tagBase>

					<!-- The SCM username if the OW2 username. -->
					<username>${ow.username}</username>

					<!-- Sub modules have the same version as this one. -->
					<autoVersionSubmodules>true</autoVersionSubmodules>

					<!-- At preparation phase, new artifacts must be installed 
						in the local repository. In particular, maven plugins 
						must be available when the release is performed because
						of the maven-source-pluging that fork a maven lifecycle
					-->
					<preparationGoals>clean install</preparationGoals>

					<!-- release goals contain "assembly:assembly" to create 
						distribution files and "antrun:run" to deploy these 
						files on the OW2 forge. -->
					<!-- TODO running the "antrun:run" goal while performing 
						release is not very clean since sub modules may defines 
						there own configuration of this plugin which may produce
						unexpected result. Should use a	more specific MOJO. -->
					<goals>clean deploy site-deploy assembly:attached antrun:run</goals>

					<!-- Forwards property values to be sure that values 
						overridden on the command line will be used while 
						performing release. 
						This is particularly useful for the antrun:run goal.-->
					<arguments>
						-Dow.username=${ow.username} -Dow.hostname=${ow.hostname} -Dow.file.deploy.dir=${ow.file.deploy.dir} -Dow.site.deploy.dir=${ow.site.deploy.dir}
					</arguments>
				</configuration>
			</plugin>

			<!-- Configure the assembly plugin. This plugin is not attached to
				the build lifecycle and must be executed explicitly. See README
				file for details -->
			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<configuration>
					<descriptorSourceDirectory>
						src/assemble
					</descriptorSourceDirectory>
					<tarLongFileMode>gnu</tarLongFileMode>
				</configuration>
				<dependencies>
					<!-- Depends on the bootstrap plugin to allow 
						maven-assembly-plugin to find a "car" (un)archiver -->
					<dependency>
						<groupId>org.objectweb.fractal</groupId>
						<artifactId>
							maven-bootstrap-cecilia-plugin
						</artifactId>
						<version>${bootstrap.plugin.version}</version>
					</dependency>
				</dependencies>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>local-site-deploy</id>

			<properties>
				<local.deploy.dir>/tmp/cecilia-site/${project.version}</local.deploy.dir>
			</properties>
			<distributionManagement>
				<site>
					<name>local site deployment</name>
					<url>file://${local.deploy.dir}</url>
				</site>
			</distributionManagement>
		</profile>

		<profile>
			<id>release-profile</id>

			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>

			<build>
				<plugins>
					<plugin>
						<!-- This Ant task will deploy distribution files on the
							OW2 forge in order to release them on the "File" 
							section of the forge. -->
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<inherited>false</inherited>
						<configuration>
							<tasks>
								<scp todir="${ow.username}@${ow.hostname}:${ow.file.deploy.dir}" verbose="true" passphrase="" keyfile="${user.home}/.ssh/id_rsa">
									<fileset dir="${basedir}/target">
										<include name="*src.tar.bz2" />
										<include name="*src.tar.gz" />
										<include name="*src.zip" />
									</fileset>
									<fileset dir="${basedir}/toolchain/cecilia-adl/target/site/downloads">
										<include name="*bin.tar.bz2" />
										<include name="*bin.tar.gz" />
										<include name="*bin.zip" />
									</fileset>
								</scp>
								<sshexec host="${ow.hostname}" username="${ow.username}" passphrase="" keyfile="${user.home}/.ssh/id_rsa" command="cd ${ow.site.deploy.dir}; ln -nfs ${project.version} current" />
							</tasks>
						</configuration>
						<dependencies>
							<dependency>
								<groupId>org.apache.ant</groupId>
								<artifactId>ant-jsch</artifactId>
								<version>1.7.0</version>
							</dependency>
						</dependencies>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>