<?xml version="1.0" encoding="UTF-8"?>

<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.gvsig</groupId>
	<artifactId>org.gvsig.fmap.geometry</artifactId>
	<packaging>jar</packaging>
	<version>2.0-SNAPSHOT</version>
	<name>libFMap_geometries</name>
	<url>http://gvsig.org</url>
	<parent>
		<groupId>org.gvsig</groupId>
		<artifactId>gvsig-base-library-pom</artifactId>
		<version>2.0-SNAPSHOT</version>
	</parent>	
	<distributionManagement>
		<site>
			<id>gvsig-repository</id>
			<url>${site-repository}/</url>
		</site>
	</distributionManagement>

	<dependencies>
		<dependency>
			<groupId>org.gvsig</groupId>
			<artifactId>org.gvsig.tools.lib</artifactId>
		</dependency>			
		<dependency>
			<groupId>com.vividsolutions</groupId>
			<artifactId>jts</artifactId>
		</dependency>
		<!-- TEST -->
		<dependency>
			<groupId>org.gvsig</groupId>
			<artifactId>org.gvsig.tools.lib</artifactId>
			<type>test-jar</type>
			<scope>test</scope>
		</dependency>		
	</dependencies>
	<properties>
		<build-dir>${basedir}/../build</build-dir>
	</properties>

	<build>
		<sourceDirectory>src</sourceDirectory>
		<testSourceDirectory>src-test</testSourceDirectory>
	</build>


	<profiles>
		<profile>
			<id>cdc</id>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>
			<dependencies>
				<dependency>
					<groupId>org.gvsig</groupId>
					<artifactId>org.gvsig.projection</artifactId>
					<version>2.0-SNAPSHOT</version>
				</dependency>
				<dependency>
					<groupId>org.gvsig</groupId>
					<artifactId>org.gvsig.jdk.v1_6</artifactId>
					<version>1.0.0-SNAPSHOT</version>
				</dependency>
			</dependencies>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-compiler-plugin</artifactId>
						<configuration>
							<excludes>
								<exclude>**/operation/fromwkb/*</exclude>
								<exclude>**/operation/towkb/*</exclude>
								<exclude>**/operation/impl/*</exclude>
							</excludes>

							<testExcludes>
								<exclude>**/fmap/geom/*</exclude>
								<exclude>**/geom/operation/**</exclude>
							</testExcludes>

						</configuration>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-jar-plugin</artifactId>
						<configuration>

							<includes>
								<include>**/**</include>
							</includes>
							<excludes>
								<exclude>**/operation/fromwkb/*</exclude>
								<exclude>**/operation/towkb/*</exclude>
								<exclude>**/operation/impl/*</exclude>
							</excludes>
						</configuration>
						<executions>
							<execution>
								<id>impl</id>
								<phase>package</phase>
								<goals>
									<goal>jar</goal>
								</goals>
								<configuration>
									<classifier>impl</classifier>
									<includes>
										<include>**/impl/**</include>
									</includes>
									<excludes>
										<exclude>**/operation/impl/**</exclude>
									</excludes>
								</configuration>
							</execution>

							<execution>
								<id>operation</id>
								<phase>package</phase>
								<goals>
									<goal>jar</goal>
								</goals>
								<configuration>
									<classifier>operation</classifier>
									<includes>
										<include>**/operation/*/*</include>
									</includes>
									<excludes>
										<exclude>**/operation/fromwkb/*</exclude>
										<exclude>**/operation/towkb/*</exclude>
									</excludes>
								</configuration>
							</execution>

						</executions>
					</plugin>
					
					<plugin>
						<artifactId>maven-antrun-plugin</artifactId>
						<executions>
							<execution>
								<id>services</id>
								<phase>package</phase>
								<goals>
									<goal>run</goal>
								</goals>
								<configuration>
									<tasks>
										<jar destfile="${project.build.directory}/${project.build.finalName}.jar"
											update="true">
											<fileset dir="${basedir}/resources/api" />
										</jar>
										<jar destfile="${project.build.directory}/${project.build.finalName}-impl.jar"
											update="true">
											<fileset dir="${basedir}/resources/impl" />
										</jar>
									</tasks>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<configuration>
							<additionalClasspathElements>
								<additionalClasspathElement>${basedir}/resources/api</additionalClasspathElement>
								<additionalClasspathElement>${basedir}/resources/impl</additionalClasspathElement>
							</additionalClasspathElements>
						</configuration>
					</plugin>
					
				</plugins>
			</build>
		</profile>
		
		<profile>
			<id>eclipse-project</id>
			<build>
				<defaultGoal>antrun:run</defaultGoal>
				<plugins>
					<plugin>
						<artifactId>maven-antrun-plugin</artifactId>
						<configuration>
							<tasks>
								<ant antfile="${build-dir}/ant-tasks/eclipse-tasks.xml"
									target="eclipse.all"/>
							</tasks>
						</configuration>
					</plugin>
				</plugins>
			</build>				
		</profile>		
	</profiles>
	<reporting>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<reportSets>
					<reportSet>
						<id>api</id>
						<configuration>
							<subpackages>org.gvsig.fmap.geom</subpackages>
							<excludePackageNames>org.gvsig.fmap.geom.operation:org.gvsig.fmap.geom.impl:org.gvsig.fmap.geom.aggregate.impl:org.gvsig.fmap.geom.primitive.impl:org.gvsig.fmap.geom.type.impl</excludePackageNames>
							<name>JavaDoc - API</name>
							<destDir>api</destDir>
						</configuration>
						<reports>
							<report>javadoc</report>
						</reports>
					</reportSet>
					<reportSet>
						<id>operation</id>
						<configuration>
							<subpackages>org.gvsig.fmap.geom.operation</subpackages>
							<name>JavaDoc - Geometry operations</name>
							<destDir>operation</destDir>
						</configuration>
						<reports>
							<report>javadoc</report>
						</reports>
					</reportSet>
					<reportSet>
						<id>impl</id>
						<configuration>
							<subpackages>org.gvsig.fmap.geom.impl:org.gvsig.fmap.geom.aggregate.impl:org.gvsig.fmap.geom.primitive.impl:org.gvsig.fmap.geom.type.impl</subpackages>
							<name>JavaDoc - Default implementation</name>
							<destDir>impl</destDir>
						</configuration>
						<reports>
							<report>javadoc</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>
		</plugins>
	</reporting>
</project>