<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>elk-parent</artifactId>
		<groupId>org.semanticweb.elk</groupId>
		<version>0.4.3</version>
	</parent>

	<artifactId>elk-distribution</artifactId>
	<packaging>jar</packaging>

	<name>ELK Distribution</name>
	<description>
		
		The module for packaging of ELK products and their distribution
	
	</description>

	<dependencies>
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>elk-standalone</artifactId>
			<version>${project.version}</version>
			<type>jar</type>
		</dependency>
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>elk-protege</artifactId>
			<version>${project.version}</version>
			<type>jar</type>
		</dependency>
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>elk-owlapi-standalone</artifactId>
			<version>${project.version}</version>
			<type>jar</type>
			<classifier>bin</classifier>
		</dependency>
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>elk-owlapi-standalone</artifactId>
			<version>${project.version}</version>
			<type>jar</type>
			<classifier>src</classifier>
		</dependency>
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>elk-owlapi-standalone</artifactId>
			<version>${project.version}</version>
			<type>jar</type>
			<classifier>lib</classifier>
		</dependency>
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>elk-owlapi</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>net.sourceforge.owlapi</groupId>
			<artifactId>owlapi-distribution</artifactId>
			<version>${owlapi.version}</version>			
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>elk-util-testing</artifactId>
			<version>${project.version}</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<properties>
		<elk-standalone.base>elk-standalone</elk-standalone.base>
		<elk-protege.base>org.semanticweb.elk</elk-protege.base>
		<elk-owlapi.base>elk-owlapi</elk-owlapi.base>
		<elk-standalone.assembly-id>standalone-executable</elk-standalone.assembly-id>
		<elk-owlapi.assembly-id>owlapi-library</elk-owlapi.assembly-id>
		<elk-protege.assembly-id>protege-plugin</elk-protege.assembly-id>
		<elk-standalone.file>
			
			${project.artifactId}-${project.version}-${elk-standalone.assembly-id}
		
		</elk-standalone.file>
		<elk-owlapi.file>
			
			${project.artifactId}-${project.version}-${elk-owlapi.assembly-id}
		
		</elk-owlapi.file>
		<elk-protege.file>
			
			${project.artifactId}-${project.version}-${elk-protege.assembly-id}
		
		</elk-protege.file>
		<!-- the following timestamp and release.version properties are used for the current
			release
			information changes.xml file -->
		<maven.build.timestamp.format>yyyy-MM-dd</maven.build.timestamp.format>
		<buildDate>${maven.build.timestamp}</buildDate>
		<release.version>
			${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}
		</release.version>
	</properties>

	<build>
		<plugins>
			<plugin>
				<!-- the plugin used to generate the modified plugin versions, such as release.version
					used
					templates/*.vm and parsedVersion.osgiVersion used in src/main/update.properties
					-->
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>1.7</version>
				<executions>
					<execution>
						<id>parse-version</id>
						<goals>
							<goal>parse-version</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<!-- the plugin to filter files by expanding the defined properties with their values;
					the
					expanded versions are copied to the target -->
				<artifactId>maven-resources-plugin</artifactId>
				<version>2.5</version>
				<executions>
					<!-- Copy Java sources to the output directory so that it's available in the classpath
						(the
						tests could compile it) -->
					<execution>
						<id>copy-examples-to-resources</id>
						<phase>process-resources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${basedir}/target/classes/owlapi-examples-src</outputDirectory>
							<resources>
								<resource>
									<directory>src/main/java/org/semanticweb/elk/owlapi/examples</directory>
									<filtering>true</filtering>
								</resource>
							</resources>
						</configuration>
					</execution>
					<execution>
						<id>copy-resources</id>
						<phase>validate</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}</outputDirectory>
							<resources>
								<!-- filtering of the update.properties and version-info.txt files used for Protege
										4 auto-update feature -->
								<!--resource>
									<directory>${basedir}/src/main/resources/protege</directory>
									<filtering>true</filtering>
									<includes>
										<include>update.properties</include>
										<include>version-info.txt</include>
									</includes>
								</resource-->
								<resource>
									<!-- filtering of the changes.xml file -->
									<directory>${basedir}/src/changes</directory>
									<filtering>true</filtering>
									<includes>
										<include>changes.xml</include>
									</includes>
								</resource>
							</resources>
						</configuration>
					</execution>


					<execution>
						<id>copy-update-properties-to-site</id>
						<phase>validate</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/site/resources</outputDirectory>
							<resources>
								<resource>
									<directory>${basedir}/src/main/resources/protege/</directory>
									<filtering>true</filtering>
									<includes>
										<include>p5.update.properties</include>
										<include>p5.version-info.txt</include>
									</includes>
								</resource>
							</resources>
						</configuration>
					</execution>

				</executions>
			</plugin>
			<!-- A plugin to expose paths to some dependency jars as properties (they will be
				propagated
				to tests) -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
									
					<execution>
						<!-- Including dependencies of owlapi for the test. -->
						<id>set-property-to-owlapi-dependencies</id>
						<goals>
							<goal>build-classpath</goal>
						</goals>
						<configuration>
							<includeScope>provided</includeScope>
							<outputProperty>owlapi.lib.path</outputProperty>
						</configuration>
					</execution>
					
				</executions>
			</plugin>

			<plugin>
				<!-- Propagating some necessary information, mostly paths to jars/zip archives, to
					the
					tests -->
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<systemProperties>
						<property>
							<name>elk-owlapi-path-in-zip</name>
							<value>/${elk-owlapi.file}/${elk-owlapi.base}.jar</value>
						</property>
						<property>
							<name>elk-owlapi-path</name>
							<value>${project.build.directory}/${elk-owlapi.file}.zip</value>
						</property>
						<property>
							<name>owlapi-path</name>
							<value>${net.sourceforge.owlapi:owlapi-osgidistribution:jar}</value>
						</property>
 						<property>
							<name>owlapi-lib-path</name>
							<value>${owlapi.lib.path}</value>
						</property>
					</systemProperties>
				</configuration>
			</plugin>

			<plugin>
				<!-- the plugin to generate changelog and release announcements -->
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-changes-plugin</artifactId>
				<configuration>
					<!-- the changes filtered source changes file -->
					<xmlPath>${basedir}/target/changes.xml</xmlPath>
					<templateDirectory>templates</templateDirectory>
				</configuration>
				<executions>
					<execution>
						<!-- checking if the changes file is well-formed -->
						<id>check-changes</id>
						<phase>verify</phase>
						<goals>
							<goal>changes-check</goal>
						</goals>
					</execution>
					<execution>
						<!-- generating of the Changes.txt file -->
						<id>generate-changes-file</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>announcement-generate</goal>
						</goals>
						<configuration>
							<announcementFile>Changes.txt</announcementFile>
							<template>changes.vm</template>
							<outputDirectory>${project.build.directory}</outputDirectory>
						</configuration>
					</execution>
					<execution>
						<!-- generation of the version-info.txt file for Protege 4 auto-update feature -->
						<id>generate-protege-version-info</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>announcement-generate</goal>
						</goals>
						<configuration>
							<announcementFile>p5.version-info.txt</announcementFile>
							<template>version-info.vm</template>
							<outputDirectory>${project.build.directory}/site/resources</outputDirectory>
						</configuration>
					</execution>
					<execution>
						<!-- generation of the e-mail announcement message announcement.txt -->
						<id>generate-email-announcement</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>announcement-generate</goal>
						</goals>
						<configuration>
							<announcementFile>announcement.txt</announcementFile>
							<template>announcement.vm</template>
							<outputDirectory>${project.build.directory}</outputDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<!-- the plugin for assembling of the distribution zip files; we will run some test
					on
					them, therefore we create them at the generate-test-resources phase -->
				<artifactId>maven-assembly-plugin</artifactId>
				<version>2.3</version>
				<executions>
					<execution>
						<!-- creating the distribution archive for elk-standalone -->
						<id>create-standalone-zip</id>
						<phase>generate-test-resources</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
							<appendAssemblyId>true</appendAssemblyId>
							<descriptors>
								<descriptor>${basedir}/src/main/assembly/standalone-zip.xml</descriptor>
							</descriptors>
						</configuration>
					</execution>
					<execution>
						<!-- creating the distribution archive for elk-protege -->
						<id>create-protege-zip</id>
						<phase>generate-test-resources</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
							<appendAssemblyId>true</appendAssemblyId>
							<descriptors>
								<!-- configuration file describing how to create the archive -->
								<descriptor>${basedir}/src/main/assembly/protege-zip.xml</descriptor>
							</descriptors>
						</configuration>
					</execution>
					<execution>
						<!-- creating the distribution archive for elk-owlapi-standalone -->
						<id>create-owlapi-zip</id>
						<phase>generate-test-resources</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
							<appendAssemblyId>true</appendAssemblyId>
							<descriptors>
								configuration file describing how to create the archive
								<descriptor>${basedir}/src/main/assembly/owlapi-zip.xml</descriptor>
							</descriptors>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<reporting>
		<plugins>
			<plugin>
				<!-- the plugin to generate changes log and release announcements -->
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-changes-plugin</artifactId>
				<version>2.7.1</version>
				<configuration>
					<!-- the changes filtered source changes file -->
					<xmlPath>${basedir}/target/changes.xml</xmlPath>
				</configuration>
			</plugin>
		</plugins>
	</reporting>

</project>
