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

	<groupId>org.kurento</groupId>
	<artifactId>kurento-module-creator</artifactId>
	<version>6.7.0</version>
	<packaging>jar</packaging>

	<!-- Project-level information -->
	<name>Kurento Module Creator</name>
	<description>
		Tool that generates code for RPC between the Kurento Media Server
		and remote libraries.
	</description>
	<url>https://www.kurento.org/docs/${project.version}</url>
	<scm>
		<url>https://github.com/Kurento/kurento-module-creator</url>
		<connection>scm:git:git://github.com/Kurento/kurento-module-creator.git</connection>
		<developerConnection>scm:git:git@github.com:Kurento/kurento-module-creator.git</developerConnection>
	</scm>

	<!-- Organization-level information -->
	<developers>
		<developer>
			<id>kurento.org</id>
			<name>Kurento Community</name>
			<organization>Kurento</organization>
			<organizationUrl>https://www.kurento.org</organizationUrl>
		</developer>
	</developers>
	<issueManagement>
		<system>GitHub</system>
		<url>https://github.com/Kurento/bugtracker/issues</url>
	</issueManagement>
	<licenses>
		<license>
			<name>Apache 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0</url>
			<distribution>repo</distribution>
		</license>
	</licenses>
	<mailingLists>
		<mailingList>
			<name>Kurento List</name>
			<subscribe>http://groups.google.com/group/kurento/subscribe</subscribe>
			<post>http://groups.google.com/group/kurento/post</post>
			<archive>http://groups.google.com/group/kurento/about</archive>
		</mailingList>
	</mailingLists>
	<organization>
		<name>Kurento</name>
		<url>https://www.kurento.org</url>
	</organization>

	<!-- Project configuration -->

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<buildDirectory>${project.basedir}/target</buildDirectory>

		<!-- See explanation below -->
		<extension.groupId>org.apache.maven.wagon</extension.groupId>
		<extension.artifactId>wagon-ssh</extension.artifactId>
		<extension.version>1.0</extension.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.10</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.google.code.gson</groupId>
			<artifactId>gson</artifactId>
			<version>2.1</version>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>1.7.5</version>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-simple</artifactId>
			<version>1.7.5</version>
		</dependency>
		<dependency>
			<groupId>org.freemarker</groupId>
			<artifactId>freemarker</artifactId>
			<version>2.3.19</version>
		</dependency>
		<dependency>
			<groupId>commons-cli</groupId>
			<artifactId>commons-cli</artifactId>
			<version>1.2</version>
		</dependency>
	</dependencies>

    <build>
		<directory>${buildDirectory}</directory>
		<resources>
			<resource>
				<directory>src/main/templates</directory>
			</resource>
			<resource>
				<filtering>true</filtering>
				<directory>src/main/cmake</directory>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.1</version>
				<configuration>
					<source>1.7</source>
					<target>1.7</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>2.2.1</version>
				<configuration>
					<finalName>kurento-module-creator</finalName>
					<descriptorRefs>
						<descriptorRef>jar-with-dependencies</descriptorRef>
					</descriptorRefs>
					<archive>
						<manifestEntries>
							<Main-Class>org.kurento.modulecreator.Main</Main-Class>
						</manifestEntries>
					</archive>
				</configuration>
				<executions>
					<execution>
						<id>assemble-all</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
		<extensions>
			<extension>
				<groupId>${extension.groupId}</groupId>
				<artifactId>${extension.artifactId}</artifactId>
				<version>${extension.version}</version>
			</extension>
		</extensions>
	</build>

	<!--
	Maven has the limitation that it doesn't allow to define new <extensions>
	as part of a <profile>, which means that we cannot easily inject the
	'maven-s3-wagon' extension when the profile 'deploy' gets enabled.

	There is a clever trick to overcome this limitation: have an harmless
	extension added by default, and then swap it with the actually desired one,
	by defining its Maven coordinates as properties in the profile.
	Source: https://stackoverflow.com/questions/17639778/maven-3-profile-with-extensions/36253007#36253007

	The default extension we are using here is 'org.apache.maven.wagon/wagon-ssh/1.0',
	because it is already provided in the Debian package 'libwagon-java', thus
	it doesn't introduce additional package dependencies at build time.
	-->
	<profiles>
		<profile>
			<id>deploy</id>
			<properties>
				<extension.groupId>org.kuali.maven.wagons</extension.groupId>
				<extension.artifactId>maven-s3-wagon</extension.artifactId>
				<extension.version>1.2.1</extension.version>
			</properties>
		</profile>
	</profiles>

</project>
