<?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>
	<artifactId>org.gvsig.fmap.geometry</artifactId>
	<packaging>jar</packaging>
	<version>2.0</version>
	<name>libFMap_geometries</name>
	<url>https://devel.gvsig.org/redmine/projects/gvsig-desktop</url>
	<parent>
		<groupId>org.gvsig</groupId>
		<artifactId>gvsig-base-library-pom</artifactId>
		<version>2.0</version>
	</parent>	
	<scm>
        <connection>scm:svn:https://devel.gvsig.org/svn/gvsig-desktop/tags/libraries/org.gvsig.fmap.geometry/2.0</connection>
        <developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-desktop/tags/libraries/org.gvsig.fmap.geometry/2.0</developerConnection>
        <url>https://devel.gvsig.org/svn/gvsig-desktop/tags/libraries/org.gvsig.fmap.geometry/2.0</url>
    </scm>
	
	<dependencies>
		<dependency>
			<groupId>org.gvsig</groupId>
			<artifactId>org.gvsig.tools.lib</artifactId>
            <scope>compile</scope>
		</dependency>			
		<dependency>
			<groupId>com.vividsolutions</groupId>
			<artifactId>jts</artifactId>
            <scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.gvsig</groupId>
			<artifactId>org.gvsig.tools.lib</artifactId>
			<type>test-jar</type>
            <scope>test</scope>
		</dependency>		
        <dependency>
            <groupId>org.gvsig</groupId>
            <artifactId>org.gvsig.projection</artifactId>
            <scope>compile</scope>
        </dependency>   
		<dependency>
			<groupId>org.gvsig</groupId>
			<artifactId>org.gvsig.projection</artifactId>
			<classifier>cresques-impl</classifier>
			<scope>test</scope>
		</dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>compile</scope>
        </dependency>
		<dependency>
			<groupId>org.opengis</groupId>
			<artifactId>geoapi</artifactId>			
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.geotools</groupId>
			<artifactId>gt2-legacy</artifactId>			
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.geotools</groupId>
			<artifactId>gt2-main</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>geojava</groupId>
			<artifactId>geojava</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>javax.media</groupId>
			<artifactId>jai_core</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>javax.media</groupId>
			<artifactId>jai_codec</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<properties>
		<build-dir>${basedir}/../build</build-dir>
        <eclipse.project.name>libFMap_geometries</eclipse.project.name>
	</properties>

	<build>
		<sourceDirectory>src</sourceDirectory>
		<testSourceDirectory>src-test</testSourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.4</source>
                    <target>1.4</target>
                </configuration>
            </plugin> 
		    <plugin>
		      <artifactId>maven-release-plugin</artifactId>
		      <version>2.0</version>
		      <configuration>
		        <tagBase>https://devel.gvsig.org/svn/gvsig-desktop/tags/libraries/${artifactId}</tagBase>
		      </configuration>
		    </plugin>
        </plugins>
	</build>

	<profiles>
		<profile>
			<id>se</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<dependencies>
				<dependency>
					<groupId>org.gvsig</groupId>
					<artifactId>org.gvsig.jdk.v1_6</artifactId>
					<version>1.0.0</version>
				</dependency>
			</dependencies>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-jar-plugin</artifactId>
						<configuration>
							<excludes>
								<exclude>**/operation/*/*</exclude>
								<exclude>**/impl/**</exclude>
							</excludes>
						</configuration>
						<executions>
							<!--
								Generates a jar file only with the geometries API TODO: make a good
								configuration of excludes and includes, when the api and implementation
								of the geometries library would be performed. <execution> <id>api</id>
								<phase>package</phase> <goals> <goal>jar</goal> </goals> <configuration>
								<classifier>api</classifier> <excludes>
								<exclude>**/operation/*/*</exclude> </excludes> </configuration>
								</execution>
							-->
							<!--
								Generates a jar file only with the geometries implementation
							-->
							<execution>
								<id>impl</id>
								<phase>package</phase>
								<goals>
									<goal>jar</goal>
								</goals>
								<configuration>
									<classifier>impl</classifier>
									<excludes>
										<exclude>**/operation/impl/**</exclude>
									</excludes>
									<includes>
										<include>**/impl/**</include>
									</includes>
								</configuration>
							</execution>
							<!--
								Generates a jar file only with the geometries operations
							-->
							<execution>
								<id>operation</id>
								<phase>package</phase>
								<goals>
									<goal>jar</goal>
								</goals>
								<configuration>
									<classifier>operation</classifier>
									<excludes>
										<exclude>NONE</exclude>
									</excludes>
									<includes>
										<include>**/operation/*/*</include>
									</includes>
								</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>
										<jar destfile="${project.build.directory}/${project.build.finalName}-operation.jar" update="true">
											<fileset dir="${basedir}/resources/operation" />
										</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>
								<additionalClasspathElement>${basedir}/resources/operation</additionalClasspathElement>
							</additionalClasspathElements>
						</configuration>
					</plugin>

				</plugins>
			</build>
		</profile>

		<profile>
			<id>cdc</id>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>
			<dependencies>
				<dependency>
					<groupId>org.gvsig</groupId>
					<artifactId>org.gvsig.jdk.v1_4</artifactId>
					<version>1.0.0</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>