<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.alfresco</groupId>
      <artifactId>alfresco-super-pom</artifactId>
      <version>9</version>
   </parent>   

    <artifactId>alfresco-centera-connector</artifactId>
    <version>2.2.0-RC1</version>
    <name>Centera Connector</name>
    <description>Alfresco Content Connector for EMC Centera</description>
    <packaging>amp</packaging>

    <scm>
        <connection>scm:git:https://git.alfresco.com/Repository/alfresco-centera-connector.git</connection>
        <developerConnection>scm:git:https://git.alfresco.com/Repository/alfresco-centera-connector.git</developerConnection>
        <url>https://git.alfresco.com/Repository/alfresco-centera-connector</url>
        <tag>alfresco-centera-connector-2.2.0-RC1</tag>
    </scm>

    <properties>
        <module.version>${project.version}</module.version>
        <module.repo.version.min>5.0.3</module.repo.version.min>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <dependency.postgresql.version>9.3-1102-jdbc41</dependency.postgresql.version>

        <!-- Database properties - default values to be overridden in settings.xml -->
        <skipTests>false</skipTests>
        <db.driver>org.postgresql.Driver</db.driver>
        <db.name>alfresco</db.name>
        <db.url>jdbc:postgresql:${db.name}</db.url>
        <db.master.url>jdbc:postgresql:template1</db.master.url>
        <db.username>alfresco</db.username>
        <db.password>alfresco</db.password>
        <db.drop.command>drop database if exists ${db.name}</db.drop.command>
        <db.create.command>create database ${db.name}</db.create.command>
        <centera.url>test_url</centera.url>
    </properties>

    <dependencies>
        <!-- Alfresco libraries -->
        <dependency>
            <groupId>org.alfresco</groupId>
            <artifactId>alfresco-enterprise-repository</artifactId>
            <version>6.22</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.alfresco</groupId>
            <artifactId>alfresco-repository</artifactId>
            <version>6.38</version>
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.10.19</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>${dependency.postgresql.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.0.1</version>
            <scope>provided</scope>
        </dependency>

        <!-- Centera library -->
        <dependency>
            <groupId>com.filepool</groupId>
            <artifactId>FPLibrary</artifactId>
            <version>3.3</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9.1</version>
                <configuration>
                    <javadocDirectory>source/javadoc</javadocDirectory>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.alfresco.maven.plugin</groupId>
                <artifactId>maven-amp-plugin</artifactId>
                <version>3.0.4</version>
                <extensions>true</extensions>
                <configuration>
                    <mAmpJarExcludes>alfresco/module/**,alfresco/extension/**,alfresco/messages/**</mAmpJarExcludes>
                    <archive>
                        <addMavenDescriptor>false</addMavenDescriptor>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.16</version>
                <configuration>
                    <!-- To prevent tests alfresco.log to be created in project roots and bother while synchronizing with SCM -->
                    <workingDirectory>${project.build.directory}</workingDirectory>
                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
                    <runOrder>alphabetical</runOrder>
                    <argLine>-Xmx2G</argLine>
                    <systemPropertyVariables>
                        <!-- Database related properties -->
                        <db.url>${db.url}</db.url>
                        <db.driver>${db.driver}</db.driver>
                        <db.name>${db.name}</db.name>
                        <db.username>${db.username}</db.username>
                        <db.password>${db.password}</db.password>
                        <dir.root>${basedir}/target/alf_test_data</dir.root>
                    </systemPropertyVariables>
                    <excludes>
                        <!-- Old implementation tests -->
                        <exclude>**/XAMContentStoreTest.java</exclude>
                        <exclude>**/XAMArchiveAspectTest.java</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>sql-maven-plugin</artifactId>
                <version>1.5</version>
                <configuration>
                    <skip>${skipTests}</skip>
                    <autocommit>true</autocommit>
                    <driver>${db.driver}</driver>
                    <url>${db.master.url}</url>
                    <username>${db.username}</username>
                    <password>${db.password}</password>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.postgresql</groupId>
                        <artifactId>postgresql</artifactId>
                        <version>${dependency.postgresql.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>wipe-database</id>
                        <phase>pre-clean</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                        <configuration>
                            <sqlCommand>${db.drop.command}</sqlCommand>
                        </configuration>
                    </execution>
                    <execution>
                        <id>create-database</id>
                        <phase>pre-clean</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                        <configuration>
                            <sqlCommand>${db.create.command}</sqlCommand>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <arguments>-Dcentera.url=${centera.url}</arguments>
                    <goals>clean deploy</goals>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
