<!--
	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU Affero General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This software is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU Affero General Public License for more details.

	You should have received a copy of the GNU Affero General Public License
	along with this software. If not, see <http://www.gnu.org/licenses/>.

	Copyright © 2010 Candid Dauth
-->
<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>
	<groupId>eu.cdauth.osm</groupId>
	<artifactId>web</artifactId>
	<version>SNAPSHOT</version>
	<name>osmrmhv/web</name>
	<description>OSM Route Manager and History Viewer.</description>
	<packaging>pom</packaging>

	<licenses>
		<license>
			<name>GNU Affero General Public License Version 3</name>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<parent>
		<groupId>eu.cdauth</groupId>
		<artifactId>osm</artifactId>
		<version>SNAPSHOT</version>
	</parent>

	<modules>
		<module>common</module>
		<module>osmrm</module>
		<module>osmhv</module>
		<!--<module>poiselect</module>-->
	</modules>

	<pluginRepositories>
		<pluginRepository>
			<id>maven-replacer-plugin repository</id>
			<url>http://maven-replacer-plugin.googlecode.com/svn/release-repo</url>
		</pluginRepository>
	</pluginRepositories>

	<properties>
		<project.build.jspFixedDirectory>${project.build.directory}/jsp-fixed</project.build.jspFixedDirectory>
	</properties>

	<dependencies>
		<dependency>
			<groupId>eu.cdauth.osm.lib</groupId>
			<artifactId>interface</artifactId>
			<version>SNAPSHOT</version>
		</dependency>
		<dependency>
			<groupId>eu.cdauth.osm.lib</groupId>
			<artifactId>api06</artifactId>
			<version>SNAPSHOT</version>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<version>2.5</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>net.sourceforge.pjl-comp-filter</groupId>
			<artifactId>pjl-comp-filter</artifactId>
			<version>1.6.4</version>
			<scope>runtime</scope>
		</dependency>
	</dependencies>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-antrun-plugin</artifactId>
					<version>1.3</version>
					<executions>
						<execution>
							<phase>compile</phase>
							<goals>
								<goal>run</goal>
							</goals>
							<configuration>
								<tasks>
									<mkdir dir="${project.build.jspFixedDirectory}" />
									<copy todir="${project.build.jspFixedDirectory}">
										<fileset dir="${basedir}/src/main/webapp" includes="**/*.jsp" />
									</copy>
								</tasks>
							</configuration>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>com.google.code.maven-replacer-plugin</groupId>
					<artifactId>maven-replacer-plugin</artifactId>
					<version>1.3.1</version>
					<executions>
						<execution>
							<phase>compile</phase>
							<goals>
								<goal>replace</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<includes>
							<include>**/*.jsp</include>
						</includes>
						<basedir>${project.build.jspFixedDirectory}</basedir>
						<replacements>
							<replacement>
								<token>(--%&gt;)(\n)</token>
								<value>$2$1</value>
							</replacement>
							<replacement>
								<token>(%&gt;)(\n)</token>
								<value>$2$1</value>
							</replacement>
						</replacements>
						<regexFlags>
							<regexFlag>MULTILINE</regexFlag>
						</regexFlags>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.codehaus.mojo.jspc</groupId>
					<artifactId>jspc-maven-plugin</artifactId>
					<executions>
						<execution>
							<phase>compile</phase>
							<goals>
								 <goal>compile</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<trimSpaces>false</trimSpaces>
						<source>1.6</source>
						<sources>
							<directory>${project.build.jspFixedDirectory}</directory>
						</sources>
					</configuration>
					<dependencies>
						<dependency>
							<groupId>org.codehaus.mojo.jspc</groupId>
							<artifactId>jspc-compiler-tomcat6</artifactId>
							<version>2.0-alpha-3</version>
						</dependency>
					</dependencies>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-war-plugin</artifactId>
					<executions>
						<execution>
							<phase>package</phase>
							<goals>
								<goal>war</goal>
							</goals>
							<configuration>
								<webXml>${pom.basedir}/target/jspweb.xml</webXml>
								<failOnMissingWebXml>false</failOnMissingWebXml>
							</configuration>
						</execution>
					</executions>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
</project>

