<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>
        <groupId>it.geosolutions.geostore</groupId>
        <artifactId>geostore-web</artifactId>
        <version>1.1.0</version>
    </parent>

    <groupId>it.geosolutions.geostore</groupId>
    <artifactId>geostore-webapp</artifactId>
    <packaging>war</packaging>

    <name>GeoStore - Webapp</name>

	<developers>
		<developer>
			<name>Emanuele Tajariol</name>
			<id>ETj</id>
			<organization>GeoSolutions</organization>
		</developer>
	</developers>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>
	
	<dependencies>
        <!-- ================================================================-->
        <!-- GeoStore modules -->
        <!-- ================================================================-->
        <dependency>
            <groupId>it.geosolutions.geostore</groupId>
            <artifactId>geostore-persistence</artifactId>
        </dependency>
        <!-- =============================================================== -->

		<dependency>
        	<groupId>it.geosolutions.geostore</groupId>
        	<artifactId>geostore-rest-impl</artifactId>
        </dependency>

	</dependencies>
	
	<!-- if you want to create a new profile for support another DB create a profile including JDBC dependency and right esclusion/inclusion rule for load the right override file -->
	<!-- Profile for supporting Postgres -->
	<profiles>
		<profile>
			<id>postgres</id>
		    <build>
		    	<!-- Copy the postgres custom geostore-datasource-ovr.properties -->
		    	<plugins>
			      <plugin>
			        <artifactId>maven-antrun-plugin</artifactId>
			        <version>1.1</version>
			        <executions>
			          <execution>
			            <phase>process-classes</phase>
			            <configuration>
			              <tasks>
			                <copy file="src/main/resources/db-conf/postgres.properties" tofile="${project.build.outputDirectory}/geostore-datasource-ovr.properties" overwrite="true" verbose="true"/>
			              </tasks>
			            </configuration>
			            <goals>
			              <goal>run</goal>
			            </goals>
			          </execution>
			        </executions>
			      </plugin>
		    	</plugins>
		    </build>
		    
		    <dependencies>
		        <dependency>
		            <groupId>postgresql</groupId>
		            <artifactId>postgresql</artifactId>
		        </dependency>
	        </dependencies>
	    </profile>

      <profile>
        <id>extjs</id>
        <dependencies>
            <dependency>
                <groupId>it.geosolutions.geostore</groupId>
                <artifactId>geostore-rest-extjs</artifactId>
            </dependency>
        </dependencies>
      </profile>
	</profiles>



	<build>
        <finalName>geostore</finalName>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<encoding>utf8</encoding>
					<source>1.6</source>
					<target>1.6</target>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<configuration>
				</configuration>
			</plugin>

			<!-- Run the application using "mvn jetty:run" -->
			<plugin>
				<groupId>org.mortbay.jetty</groupId>
				<artifactId>maven-jetty-plugin</artifactId>
				<version>6.1.20</version>
				<configuration>
<!--					<webAppSourceDirectory>${basedir}/war</webAppSourceDirectory>-->
					<webAppConfig>
						<contextPath>/geostore</contextPath>
					</webAppConfig>
					<connectors>
						<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
							<port>9191</port>
							<maxIdleTime>60000</maxIdleTime>
						</connector>
					</connectors>
					<reload>manual</reload>
				</configuration>
			</plugin>

		</plugins>

	</build>
	

</project>
