<?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>

    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
    </parent>

    <groupId>nl.cloudfarming.client</groupId>
    <artifactId>agrosense</artifactId>
    <version>12.10.1-beta</version>
    <packaging>pom</packaging>
    
    <name>AgroSense - NetBeans Platform Application</name>
    <description>AgroSense is a highly modular farm management system base on the netbeans platform.</description>
    
    <modules>
        <module>branding</module>
        <module>application</module>
        <module>util</module>
        <module>logging</module>
        <module>geoviewer</module>
        <module>menu</module>
        <module>uc-core</module>
        <module>farm</module>
        <module>util-swing</module>
        <module>field</module>
        <module>task</module>
        <module>fleet</module>
        <module>sensor</module>
        <module>isobus</module>
        <module>model</module>
        <module>imp</module>
        <module>crop</module>
        <module>stock</module>
        <module>welcome</module>
  </modules>

    <properties>
        <netbeans.version>RELEASE72</netbeans.version>
        <brandingToken>agrosense</brandingToken>
        <releaseVersion>12.10.1-beta</releaseVersion>
        <eventbus.version>1.0.3-NB72</eventbus.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <lib-common.version>1.2-NB72</lib-common.version>
        <lib-geotools.version>2.7.5-NB72</lib-geotools.version>
        <lib-jaxb.version>2.2.6.1-NB72</lib-jaxb.version>
        <lib-swingx.version>1.6.1-NB72</lib-swingx.version>
        <lib-beansbinding.version>1.2.1-NB72</lib-beansbinding.version>
        <lib-flamengo.version>5.0-NB72</lib-flamengo.version>
        <agrosense.core.version>${project.version}</agrosense.core.version>
        
    </properties>    
    <organization>
        <name>AgroSense</name>
        <url>http://www.agrosense.eu</url>
    </organization>
        

    <licenses>
        <license>
            <name>Eclipse Public License - v 1.0</name>
            <url>http://www.eclipse.org/legal/epl-v10.html</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:hg:file://localhost${basedir}</connection>
        <developerConnection>scm:hg:file://localhost${basedir}</developerConnection>
        <url>https://hg.java.net/hg/agrosense~core </url>
    </scm>

    <url>http://agrosense.java.net</url>

    <issueManagement>
        <system>Jira</system>
        <url>http://java.net/jira/browse/AGROSENSE</url>
    </issueManagement>
    
    <ciManagement>
        <system>Jenkins</system>
        <url>http://build.agrosense.nl</url>
    </ciManagement>    

    <repositories>
        <repository>
            <id>netbeans</id>
            <name>NetBeans Platform Maven Repository</name>
            <url>http://bits.netbeans.org/maven2/</url>
        </repository>
    </repositories>
    
    <dependencies>
        <dependency>
            <groupId>org.netbeans.modules</groupId>
            <artifactId>org-netbeans-core-windows</artifactId>
        </dependency>
    </dependencies>
    
    <dependencyManagement>
        <dependencies>
            <dependency>
                <artifactId>javadbf</artifactId>
                <groupId>com.linuxense</groupId>
                <version>0.4.0</version>
            </dependency>            
            <dependency>
                <groupId>net.sf.opencsv</groupId>
                <artifactId>opencsv</artifactId>
                <version>2.0</version>
            </dependency>            
            <dependency>
                <groupId>nl.cloudfarming.client</groupId>
                <artifactId>lib-beansbinding</artifactId>
                <version>${lib-beansbinding.version}</version>
            </dependency>            
            <dependency>
                <groupId>nl.cloudfarming.client</groupId>
                <artifactId>lib-flamengo</artifactId>
                <version>${lib-flamengo.version}</version>
            </dependency>            
            <dependency>
                <groupId>org.netbeans.modules</groupId>
                <artifactId>org-netbeans-core-windows</artifactId>
                <version>${netbeans.version}</version>
                <scope>provided</scope>
            </dependency>                
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>lib-common</artifactId>
                <version>${lib-common.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>lib-geotools</artifactId>
                <version>${lib-geotools.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>lib-jaxb</artifactId>
                <version>${lib-jaxb.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>lib-swingx</artifactId>
                <version>${lib-swingx.version}</version>
            </dependency>
            <dependency>
                <groupId>com.vividsolutions</groupId>
                <artifactId>jts</artifactId>
                <version>1.11</version>
                <type>jar</type>
            </dependency>
            <dependency>
                <groupId>nl.cloudfarming.eventbus</groupId>
                <artifactId>cloudfarming-eventbus</artifactId>
                <version>${eventbus.version}</version>
            </dependency>
            <dependency>
                <groupId>cobertura</groupId>
                <artifactId>cobertura</artifactId>
                <version>1.8</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-all</artifactId>
                <version>1.8.5</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.miglayout</groupId>
                <artifactId>miglayout</artifactId>
                <version>3.7.3.1</version>
                <type>jar</type>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <scope>test</scope>
                <version>4.8.2</version>
            </dependency>
            <dependency>
                <groupId>org.uispec4j</groupId>
                <artifactId>uispec4j</artifactId>
                <scope>test</scope>
                <version>2.4</version>
            </dependency>
            <dependency>
                <groupId>org.netbeans.api</groupId>
                <artifactId>org-netbeans-modules-nbjunit</artifactId>
                <version>${netbeans.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.netbeans.modules</groupId>
                <artifactId>org-netbeans-insane</artifactId>
                <version>${netbeans.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.netbeans.api</groupId>
                <artifactId>org-netbeans-modules-jellytools-platform</artifactId>
                <version>${netbeans.version}</version>
                <scope>test</scope>
            </dependency>            
            
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>1.5.11</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-jdk14</artifactId>
                <version>1.5.11</version>
            </dependency>
            <dependency>
                <groupId>com.sun.jersey</groupId>
                <artifactId>jersey-json</artifactId>
                <version>1.9</version>
            </dependency>
            <dependency>
                <groupId>com.sun.jersey</groupId>
                <artifactId>jersey-server</artifactId>
                <version>1.9</version>
            </dependency>
            <dependency>
                <groupId>com.sun.jersey</groupId>
                <artifactId>jersey-client</artifactId>
                <version>1.9</version>
            </dependency>
            <dependency>
                <groupId>com.sun.jersey.contribs</groupId>
                <artifactId>jersey-multipart</artifactId>
                <version>1.9</version>
            </dependency>
            <dependency>
                <groupId>com.sun.jersey.contribs.jersey-oauth</groupId>
                <artifactId>oauth-client</artifactId>
                <version>1.3</version>
            </dependency>
            <dependency>
                <groupId>com.sun.jersey.contribs.jersey-oauth</groupId>
                <artifactId>oauth-signature</artifactId>
                <version>1.3</version>
            </dependency>
            <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-tools-common</artifactId>
                <version>2.4.3</version>
            </dependency>
            <dependency>
                <groupId>com.sun.codemodel</groupId>
                <artifactId>codemodel</artifactId>
                <version>2.5</version>
            </dependency>
            <dependency>
                <groupId>javax.ws.rs</groupId>
                <artifactId>jsr311-api</artifactId>
                <version>1.1.1</version>
            </dependency>
            <dependency>
                <groupId>org.netbeans.external</groupId>
                <artifactId>ValidationAPI</artifactId>
                <version>${netbeans.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <autoVersionSubmodules>true</autoVersionSubmodules>
        </configuration>
      </plugin>
            <plugin>
                <inherited>false</inherited>
                <groupId>com.mycila.maven-license-plugin</groupId>
                <artifactId>maven-license-plugin</artifactId>
                <version>1.10.b1</version>
                <configuration>
                    <header>${basedir}/etc/header.txt</header>
                    <validHeaders>
                        <validHeader>${basedir}/etc/netbeans_eclipse_template.txt</validHeader>
                        <validHeader>${basedir}/etc/netbeans_cddl_gplv2.txt</validHeader>
                    </validHeaders>
                    <failIfMissing>true</failIfMissing>
                    <aggregate>true</aggregate>
<!--                    <properties>
                        <owner>Agrosense</owner>
                        <year>2011</year>
                        <email>info@cloudfarming.nl</email>
                    </properties>-->
                    <excludes>
                        <exclude>LICENSE.txt</exclude>
                        <exclude>etc/license.txt</exclude>
                        <exclude>**/src/test/resources/**</exclude>
                        <exclude>**/src/test/data/**</exclude>
                        <exclude>**/resources/**</exclude>
                        <exclude>**/site/**</exclude>
                        <exclude>**/*.properties</exclude>
                        <exclude>**/*.xml</exclude>
                        <exclude>**/*.mf</exclude>
                        <exclude>**/*.log</exclude>
                        <exclude>**/*.form</exclude>
                        <exclude>**/.hgtags</exclude>
                        <exclude>**/.hgignore</exclude>
                        <exclude>**/*.orig</exclude>
                        <exclude>**/*.CSV</exclude>
                        <exclude>**/*.script</exclude>
                        <exclude>**/menu/**</exclude>
                        <exclude>**/toelatingen.xsd</exclude>
                        <exclude>**/generated/**</exclude>
                        <exclude>**/xmlschema/**</exclude>
                        <exclude>**/translations/omegat/**</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <id>check-headers</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>nbm-maven-plugin</artifactId>
                    <version>3.8</version>
                    <extensions>true</extensions>
                    <configuration>
                        <forcedVersion>RELEASE10</forcedVersion>
<!--                    <installDirName>AgroSense-1.0</installDirName>-->
<!--                    <finalName>AgroSense-1.0.20</finalName>-->
                        <defaultCluster>agrosense</defaultCluster>
                        <detail>true</detail>
                        <brandingToken>${brandingToken}</brandingToken>
                        <cluster>agrosense</cluster>
                        <etcConfFile>src/main/resources/application.conf</etcConfFile> 
                        <templateFile>src/main/resources/template.xml</templateFile>
<!--                    <userSettings>nbi.icon.file=""</userSettings>-->
                    
                    
                        <installerOsLinux>true</installerOsLinux>
                        <installerOsMacosx>true</installerOsMacosx>
                        <installerOsSolaris>true</installerOsSolaris>
                        <installerOsWindows>true</installerOsWindows>
                    </configuration>                     
<!--                <configuration>
                    <defaultCluster>agrosense</defaultCluster>
                    <detail>true</detail>
                    <brandingToken>AgroSense</brandingToken>
                    <cluster>agrosense</cluster>
                    <etcConfFile>src/main/resources/application.conf</etcConfFile>     
                </configuration>                     -->
                </plugin>

                <plugin>
                    <!-- netbeans modules in 6.9+ are 1.6 compatible -->
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.5.1</version>
                    <configuration>
                        <source>1.7</source>
                        <target>1.7</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.12.2</version>
                    <configuration>
                        <!-- to prevent the Expecting a stackmap frame at branch target error from cobertura-->
                        <argLine>-XX:-UseSplitVerifier</argLine>
                        <systemProperties>
                            <property>
                                <name>cluster.path.final</name>
                                <value>${project.build.directory}/${brandingToken}/${brandingToken}:${project.build.directory}/${brandingToken}/platform</value>
                            </property>
                        </systemProperties>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.4</version>
                    <configuration>
                        <!-- to have the jar plugin pickup the nbm generated manifest -->
                        <useDefaultManifestFile>true</useDefaultManifestFile>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>cobertura-maven-plugin</artifactId>
                    <version>2.5.1</version>
                    <configuration>
                        <instrumentation>
                            <excludes>
                                <exclude>nl/cloudfarming/client/**/*Panel.class</exclude>
                                <exclude>nl/cloudfarming/client/**/*TopComponent.class</exclude>
                                <exclude>nl/cloudfarming/client/**/*Exception.class</exclude>
                                <exclude>nl/cloudfarming/client/**/*TopComponent*.class</exclude>
                                <exclude>nl/cloudfarming/client/**/*Panel*.class</exclude>
                                <exclude>nl/cloudfarming/client/model/*/**.class</exclude>
                            </excludes>                         
                        </instrumentation>
                        <formats>
                            <format>html</format>
                            <format>xml</format>
                        </formats>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>nl.cloudfarming.mojo</groupId>
                    <artifactId>omegat-maven-plugin</artifactId>
                    <version>0.2</version>
                    <configuration>
                        <sourceLanguage>en</sourceLanguage>
                        <targetLanguages>nl,pt_BR</targetLanguages>
                        <translationRootPath>translations/omegat</translationRootPath>
                        <translationRootType>session</translationRootType>
                        <omegatTargetDir>results</omegatTargetDir>
                        <filesets>
                            <fileset>
                                <directory>${project.build.outputDirectory}</directory>
                                <outputDirectory>${basedir}/src/main/resources</outputDirectory>
                                <includes>
                                    <include>**/Bundle.properties</include>
                                    <include>**/*.html</include>
                                    <!-- FIXME:
                                    These helpset xml files (all except map) contain text elements and attributes that need to be translated.
                                    We can copy them, but OmegaT won't pick them up because they don't match any of supported xml file formats.

                                    <include>**/*-hs.xml</include>
                                    <include>**/*-idx.xml</include>
                                    <include>**/*-toc.xml</include>
                                    -->
                                </includes>
                                <!-- FIXME: 
                                prevent translated files from getting pulled into the OmegaT sources again:
                                -->
                                <excludes>
                                    <exclude>**/*_nl.html</exclude>
                                    <exclude>**/*_en.html</exclude>
                                    <exclude>**/*_pt_BR.html</exclude>
                                </excludes>
                            </fileset>
                            <fileset>
                                <directory>${basedir}/src/main/nbm-branding</directory>
                                <outputDirectory>${basedir}/src/main/nbm-branding</outputDirectory>
                                <includes>
                                    <include>**/Bundle.properties</include>
                                    <include>**/masterHelpPage.html</include>
                                </includes>
                            </fileset>
                        </filesets>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <reports>
        <report>
                <!-- The following is the plugin for cobertura, which takes care of integration and report generation-->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <configuration>
                    <check>
                        <branchRate>80</branchRate>
                        <lineRate>80</lineRate>
                        <haltOnFailure>true</haltOnFailure>
                        <totalBranchRate>80</totalBranchRate>
                        <totalLineRate>80</totalLineRate>
                        <packageLineRate>80</packageLineRate>
                        <packageBranchRate>80</packageBranchRate>
                    </check>
                    <instrumentation>

                        
                        <!--

                        <ignores>
                        </ignores>-->
                    </instrumentation>
                    <formats>
                        <format>html</format>
                        <format>xml</format>
                    </formats>
                </configuration>
            </plugin>
        </report>
    </reports>
    <profiles>
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.4</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>integration-test</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>2.12.2</version>
                        <configuration>
                            <includes>
                                <include>**/*IT.java</include>
                                <include>**/*Test.java</include>
                                <include>**/Test*.java</include>
                            </includes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>copy-sources-to-omegat</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>nl.cloudfarming.mojo</groupId>
                        <artifactId>omegat-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-sources</id>
                                <phase>process-classes</phase>
                                <goals>
                                    <goal>copy-sources</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>    
        <profile>
            <id>get-translations-from-omegat</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>nl.cloudfarming.mojo</groupId>
                        <artifactId>omegat-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-translations</id>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>copy-translations</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <developers>
        <developer>
            <name>AgroSense development team</name>
            <url>http://java.net/projects/agrosense/members</url>
        </developer>        
    </developers>

</project>
