<?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.projection.app.cresques</artifactId>
  <packaging>jar</packaging>
  <name>CRS: basic management (Cresques based, java)</name>
  <description>Basic CRS management implementation based on the Cresques java library. 
Provides basic management of CRS for a very reduced set of CRS, has features such as:
- Allows setting the coordinate reference system (CRS), by default, in views and layers.
- Supports conversion of coordinates (no datum changing).
- Supports transformation of coordinates (datum changing).
</description>
  <parent>
      <groupId>org.gvsig</groupId>
      <artifactId>org.gvsig.projection.app</artifactId>
      <version>2.0.16</version>
  </parent>
  
  
    <repositories>
      <repository>
          <id>osgeo</id>
          <name>Open Source Geospatial Foundation</name>
          <url>http://download.osgeo.org/webdav/geotools</url>
          <releases>
              <enabled>true</enabled>
              <updatePolicy>never</updatePolicy>
              <checksumPolicy>warn</checksumPolicy>
          </releases>
          <snapshots>
              <enabled>false</enabled>
          </snapshots>
      </repository>
    </repositories>
  
  
  <dependencies>
     <dependency>
         <groupId>javax.units</groupId>
         <artifactId>jsr108</artifactId>
         <scope>runtime</scope>
       </dependency>
      <dependency>
          <groupId>org.gvsig</groupId>
          <artifactId>org.gvsig.andami</artifactId>
          <scope>provided</scope>
      </dependency>
      <dependency>
          <groupId>org.gvsig</groupId>
          <artifactId>org.gvsig.i18n</artifactId>
          <scope>provided</scope>
      </dependency>
      <dependency>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
          <scope>provided</scope>
      </dependency>

      <dependency>
          <groupId>org.gvsig</groupId>
          <artifactId>org.gvsig.projection.cresques.ui</artifactId>
          <scope>runtime</scope>
      </dependency>
      <dependency>
          <groupId>org.gvsig</groupId>
          <artifactId>org.gvsig.projection.api</artifactId>
          <scope>runtime</scope>
      </dependency>
      <dependency>
        <groupId>org.opengis</groupId>
        <artifactId>geoapi</artifactId>
        <scope>runtime</scope>
      </dependency>
      <dependency>
        <groupId>javax.media</groupId>
        <artifactId>jai_core</artifactId>
        <scope>runtime</scope>
      </dependency>
      <dependency>
        <groupId>javax.media</groupId>
        <artifactId>jai_codec</artifactId>
        <scope>runtime</scope>
      </dependency>
      <dependency>
        <groupId>geojava</groupId>
        <artifactId>geojava</artifactId>
        <scope>runtime</scope>
      </dependency>
      <dependency>
        <groupId>org.geotools</groupId>
        <artifactId>gt2-legacy</artifactId>
        <scope>runtime</scope>
      </dependency>
      <dependency>
        <groupId>org.geotools</groupId>
        <artifactId>gt2-main</artifactId>
        <scope>runtime</scope>
      </dependency>
      <dependency>
        <groupId>org.geotools</groupId>
        <artifactId>gt2-referencing</artifactId>
        <scope>runtime</scope>
      </dependency>
      <dependency>
        <groupId>commons-dbcp</groupId>
        <artifactId>commons-dbcp</artifactId>
        <scope>runtime</scope>
      </dependency>
      <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <scope>runtime</scope>
      </dependency>
      <dependency>
          <groupId>org.gvsig</groupId>
          <artifactId>org.gvsig.projection.cresques.impl</artifactId>
          <scope>runtime</scope>
      </dependency>

  </dependencies>

  <properties>
      <gvsig.package.info.codealias>org.gvsig.projection.app.mainplugin</gvsig.package.info.codealias>
	  <gvsig.package.info.official>true</gvsig.package.info.official>
	  <gvsig.package.info.dependencies>conflict: org.gvsig.projection.app.proj4j -ge 1</gvsig.package.info.dependencies>
  </properties>

  <profiles>
      <profile>
        <id>gvsig-plugin</id>
        <activation>
          <file>
            <exists>buildNumber.properties</exists>
          </file>
        </activation>
        <build>
          <plugins>

            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                  <execution>
                    <id>gvsig-plugin-package</id>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                  </execution>
                </executions>
            </plugin>

            <plugin>
              <artifactId>maven-clean-plugin</artifactId>
              <configuration>
                <skip>false</skip>
                <failOnError>true</failOnError>
                <filesets>
                  <fileset>
                    <directory>${gvsig.product.folder.path}/gvSIG/extensiones/${project.artifactId}</directory>
                  </fileset>
                </filesets>
              </configuration>
              <executions>
                <execution>
                  <id>default-clean</id>
                  <phase>clean</phase>
                </execution>
              </executions>
            </plugin>


            <plugin>
              <groupId>org.codehaus.gmaven</groupId>
              <artifactId>gmaven-plugin</artifactId>
              <executions>

                <execution>
                  <id>increase-build-number</id>
                  <phase>process-sources</phase>
                  <goals>
                    <goal>execute</goal>
                  </goals>
                </execution>

                <execution>
                  <id>build-package-info</id>
                  <phase>prepare-package</phase>
                  <goals>
                    <goal>execute</goal>
                  </goals>
                </execution>

                <execution>
                  <id>build-package-index</id>
                  <phase>package</phase>
                  <goals>
                    <goal>execute</goal>
                  </goals>
                </execution>

                <execution>
                  <id>install-plugin</id>
                  <phase>install</phase>
                  <goals>
                    <goal>execute</goal>
                  </goals>
                  <configuration>
                    <source><![CDATA[
                      //
                      // Don't install the gvsig plugin by default in the product/gvSIG/extensiones,
                      // only install the package in the product/install folder.
                      //
                      ant = new AntBuilder()
                      pkgname = "gvSIG-desktop-" + 
                        project.properties["gvsig.package.info.gvSIGVersion"] + "-" + 
                        project.artifactId + "-" + 
                        project.properties["gvsig.package.info.version"] + "-" + 
                        project.properties["buildNumber"] + "-" + 
                        project.properties["gvsig.package.info.state"] + "-" + 
                        project.properties["gvsig.package.info.operatingSystem"] + "-" + 
                        project.properties["gvsig.package.info.architecture"] + "-" + 
                        project.properties["gvsig.package.info.javaVM"]
                        
                      source = project.basedir.getAbsolutePath() + "/target/" + pkgname + ".gvspkg.zip"
                      target = new File(project.properties["gvsig.product.folder.path"] + 
                        "/install/" + 
                        project.artifactId + "/" +
                        pkgname + ".gvspkg")
                      target.getParentFile().mkdirs()

                      log.info("Copy plugin package from " + source + " to " + target)
                      ant.copy(file:source, tofile:target.getAbsolutePath())

                      source  = project.basedir.getAbsolutePath() + "/target/" + pkgname + ".gvspki"
                      target = project.properties["gvsig.product.folder.path"] + 
                        "/install/" + 
                        project.artifactId + "/" +
                        pkgname + ".gvspki"
                      log.info("Copy plugin package index from " + source + " to " + target)
                      ant.copy(file:source, tofile:target)

                    ]]></source>
                  </configuration>
                </execution>

              </executions>
            </plugin>

          </plugins>
        </build>
      </profile>

  </profiles>

</project>

