<?xml version="1.0"?>
<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.acquitygroup.demandware</groupId>
    <artifactId>demandware-testing-framework</artifactId>
    <version>0.03</version>
    <packaging>jar</packaging>

    <parent>
        <groupId>com.clickconcepts.project</groupId>
        <artifactId>master-site-pom</artifactId>
        <version>0.19</version>
    </parent>

    <name>${project.artifactId}</name>
    <description>This is the testing framework base for a Demandware implementation</description>
    <url>${project.scm.url}</url>

    <ciManagement>
        <system>Bamboo</system>
        <url>https://mike-acquitygroup.atlassian.net/builds</url>
    </ciManagement>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:ssh://git@${repository.domain}/${repository.user}/${repository.name}.git</connection>
        <developerConnection>scm:git:ssh://git@${repository.domain}/${repository.user}/${repository.name}.git</developerConnection>
        <url>https://${repository.domain}/${repository.user}/${repository.name}</url>
        <tag>demandware-testing-framework-0.03</tag>
    </scm>

    <distributionManagement>
        <site>
            <id>site-docs</id>
            <url>file://${site-docs.url}</url>
        </site>
        <repository>
            <id>nexus-releases</id>
            <name>Nexus Release Repository</name>
            <url>http://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <name>Nexus Snapshot Repository</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        </snapshotRepository>
        <downloadUrl>${project.scm.url}</downloadUrl>
    </distributionManagement>

    <inceptionYear>2012</inceptionYear>

    <organization>
        <name>Acquity Group</name>
        <url>http://www.acquitygroup.com</url>
    </organization>

    <developers>
        <developer>
            <name>Mike Ensor</name>
            <email>mike.ensor@acquitygroup.com</email>
            <organization>Acquity Group</organization>
            <organizationUrl>http://www.acquitygroup.com</organizationUrl>
            <roles>
                <role>Enterprise Architect</role>
            </roles>
        </developer>
    </developers>

    <properties>
        <repository.domain>bitbucket.org</repository.domain>
        <repository.user>mikeensor</repository.user>
        <repository.name>${project.artifactId}</repository.name>
        <!-- Parameters for Site Docs -->
        <scmUrl>${project.scm.url}</scmUrl>
        <gitUrl>git@${repository.domain}:${repository.user}/${repository.name}.git</gitUrl>
        <!-- Used for Google Search on Site Documentation page -->
        <sitesearchValue>${repository.user}.${repository.domain}</sitesearchValue>

        <!-- Override Site Documentation SCM publishing parameters  -->
        <scm-publish.scmBranch>master</scm-publish.scmBranch>
        <scm-publish.pubScmUrl>scm:git:git@bitbucket.org:mikeensor/mikeensor.bitbucket.org.git</scm-publish.pubScmUrl>

        <!-- Location of where "site" documentation is output -->
        <siteOutputDirectory>${project.build.directory}/site/${project.artifactId}</siteOutputDirectory>

        <!-- Groovy version and Groovy major version for the compiler -->
        <groovy.version>2.0.7</groovy.version>
        <groovy.version.major>2.0</groovy.version.major>

        <!-- dependency versions -->
        <clickconcepts-logging.version>0.01</clickconcepts-logging.version>
        <geb.version>0.9.0-RC-1</geb.version>
        <hamcrest.version>1.3</hamcrest.version>
        <jackson.version>1.9.12</jackson.version>
        <joda-time.version>2.2</joda-time.version>
        <junit.version>4.11</junit.version>
        <selenium.version>2.31.0</selenium.version>
        <spock.version>0.7-groovy-2.0</spock.version>

        <guava.version>14.0</guava.version>

        <!-- Groovy Plugin Version -->
        <gmaven.version>1.5</gmaven.version>

        <!-- Overwrite from Parent Pom  -->
        <codenarc.skip>false</codenarc.skip>
        <changelog.fileUri>${changelog.bitbucket.fileUri}</changelog.fileUri>
        <changelog.revision.fileUri>${changelog.revision.bitbucket.fileUri}</changelog.revision.fileUri>
        <groovydoc.skip>false</groovydoc.skip>

        <!-- Variable for Webdriver  -->
        <path.to.webdriver>${env.WEBDRIVER_HOME}</path.to.webdriver>
        <!-- By default, no reference to phantom JS binaries; GhostDriver is not production ready yet -->
        <path.to.phantomjs />
    </properties>

    <issueManagement>
        <url>https://mike-acquitygroup.atlassian.net/issues/</url>
        <system>Atlassian JIRA</system>
    </issueManagement>

    <build>
        <resources>
            <resource>
                <directory>src/main/groovy</directory>
            </resource>
            <resource>
                <directory>src/main/java</directory>
            </resource>
        </resources>
        <testResources>
            <testResource>
                <directory>src/test/groovy</directory>
            </testResource>
            <testResource>
                <directory>src/test/resources</directory>
            </testResource>
        </testResources>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <inherited>true</inherited>
                    <configuration>
                        <argLine>${surefire.jvm.args}</argLine>
                        <failIfNoTests>false</failIfNoTests>
                        <includes>
                            <include>**/*Test.java</include>
                            <include>**/*Specification.java</include>
                        </includes>
                        <systemProperties>
                            <geb.build.baseUrl>http://acquitygroup01.alliance-prtnr-na01.dw.demandware.net/on/demandware.store/Sites-SiteGenesis-Site/</geb.build.baseUrl>
                            <geb.build.reportsDir>target/test-reports/geb</geb.build.reportsDir>
                            <webdriver.chrome.driver>${path.to.webdriver}</webdriver.chrome.driver>
                            <PHANTOMJS_EXECUTABLE>${path.to.phantomjs}</PHANTOMJS_EXECUTABLE>
                        </systemProperties>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.gmaven</groupId>
                    <artifactId>gmaven-plugin</artifactId>
                    <version>${gmaven.version}</version>
                    <configuration>
                        <debug>true</debug>
                        <verbose>true</verbose>
                        <stacktrace>true</stacktrace>
                        <defaultScriptExtension>.groovy</defaultScriptExtension>
                        <source>2.0</source>
                        <providerSelection>${groovy.version.major}</providerSelection>
                        <sources>
                            <fileset>
                                <directory>${pom.basedir}/src/main/groovy</directory>
                                <includes>
                                    <include>**/*.groovy</include>
                                </includes>
                            </fileset>
                        </sources>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>generateStubs</goal>
                                <goal>compile</goal>
                                <goal>generateTestStubs</goal>
                                <goal>testCompile</goal>
                            </goals>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>org.codehaus.gmaven.runtime</groupId>
                            <artifactId>gmaven-runtime-2.0</artifactId>
                            <version>1.5</version>
                            <exclusions>
                                <exclusion>
                                    <groupId>org.codehaus.groovy</groupId>
                                    <artifactId>groovy-all</artifactId>
                                </exclusion>
                            </exclusions>
                        </dependency>
                        <dependency>
                            <groupId>org.codehaus.groovy</groupId>
                            <artifactId>groovy-all</artifactId>
                            <version>${groovy.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>groovydoc</id>
                        <phase>site</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <skip>${groovydoc.skip}</skip>
                            <target>
                                <taskdef name="groovydoc" classname="org.codehaus.groovy.ant.Groovydoc" classpathref="maven.runtime.classpath" />
                                <groovydoc destdir="${siteOutputDirectory}/groovydoc" sourcepath="${project.basedir}/src/main/groovy" packagenames="**.*" use="true" windowtitle="${project.name}" doctitle="${project.name}" header="${project.name}" footer="${project.name}" private="false">
                                    <link packages="java.,org.xml.,javax.,org.xml." href="http://download.oracle.com/javase/6/docs/api" />
                                    <link packages="geb." href="http://www.gebish.org/manual/0.9.0-RC-1/api" />
                                    <link packages="spock." href="http://spockframework.github.com/spock/javadoc/latest" />
                                    <link packages="org.apache.tools.ant." href="http://evgeny-goldin.org/javadoc/ant/api" />
                                    <link packages="org.junit.,junit.framework." href="http://kentbeck.github.com/junit/javadoc/latest" />
                                    <link packages="groovy.,org.codehaus.groovy." href="http://groovy.codehaus.org/api/" />
                                    <link packages="org.codehaus.gmaven." href="http://evgeny-goldin.org/javadoc/gmaven" />
                                </groovydoc>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
            <!-- Attach Test Jar -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>verify</phase>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                        <configuration>
                            <excludes>
                                <exclude>**/GebConfig.groovy</exclude>
                                <exclude>**/logback-test.xml</exclude>
                            </excludes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>

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

        </plugins>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.clickconcepts.spock</groupId>
                <artifactId>spock-feature-override-extension</artifactId>
                <version>0.01</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>joda-time</groupId>
                <artifactId>joda-time</artifactId>
                <version>${joda-time.version}</version>
            </dependency>
            <dependency>
                <groupId>org.codehaus.jackson</groupId>
                <artifactId>jackson-mapper-asl</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>org.codehaus.jackson</groupId>
                <artifactId>jackson-core-asl</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.inject</groupId>
                <artifactId>guice</artifactId>
                <version>3.0</version>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-library</artifactId>
                <version>${hamcrest.version}</version>
            </dependency>
            <dependency>
                <artifactId>hamcrest-core</artifactId>
                <groupId>org.hamcrest</groupId>
                <version>${hamcrest.version}</version>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>
            <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-chrome-driver</artifactId>
                <version>${selenium.version}</version>
            </dependency>
            <dependency>
                <groupId>com.saucelabs</groupId>
                <artifactId>sauce-rest-api</artifactId>
                <version>1.1</version>
            </dependency>
            <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-firefox-driver</artifactId>
                <version>${selenium.version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.detro.ghostdriver</groupId>
                <artifactId>phantomjsdriver</artifactId>
                <version>1.0.3-dev</version>
                <scope>test</scope>
            </dependency>
            <!-- Selenium's HtmlUnit-driver for Geb -->
            <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-htmlunit-driver</artifactId>
                <version>${selenium.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpclient</artifactId>
                <version>4.2.3</version>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>2.4</version>
            </dependency>
            <dependency>
                <groupId>commons-codec</groupId>
                <artifactId>commons-codec</artifactId>
                <version>1.7</version>
            </dependency>
            <dependency>
                <groupId>xml-apis</groupId>
                <artifactId>xml-apis</artifactId>
                <version>1.4.01</version>
            </dependency>
            <dependency>
                <groupId>com.clickconcepts.logging</groupId>
                <artifactId>clickconcepts-logging</artifactId>
                <version>${clickconcepts-logging.version}</version>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>org.spockframework</groupId>
                <artifactId>spock-core</artifactId>
                <version>${spock.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-all</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <!-- Geb testing framework -->
            <dependency>
                <groupId>org.gebish</groupId>
                <artifactId>geb-core</artifactId>
                <version>${geb.version}</version>
            </dependency>
            <!-- integration of Geb and Spock -->
            <dependency>
                <groupId>org.gebish</groupId>
                <artifactId>geb-spock</artifactId>
                <version>${geb.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>com.clickconcepts.spock</groupId>
            <artifactId>spock-feature-override-extension</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.clickconcepts.logging</groupId>
            <artifactId>clickconcepts-logging</artifactId>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
        </dependency>
        <dependency>
            <groupId>biz.neustar</groupId>
            <artifactId>browsermob-proxy</artifactId>
            <version>2.0-beta-6</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.seleniumhq.selenium</groupId>
                    <artifactId>selenium-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-jdk14</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>

        <!-- Groovy library -->
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <version>${groovy.version}</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-groovydoc</artifactId>
            <version>${groovy.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.codehaus.groovy</groupId>
                    <artifactId>groovy</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <artifactId>hamcrest-core</artifactId>
                    <groupId>org.hamcrest</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-support</artifactId>
            <version>${selenium.version}</version>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>${selenium.version}</version>
        </dependency>

        <dependency>
            <groupId>com.saucelabs</groupId>
            <artifactId>sauce-rest-api</artifactId>
            <version>1.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.6</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>hamcrest-core</artifactId>
                    <groupId>org.hamcrest</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-chrome-driver</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-firefox-driver</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.github.detro.ghostdriver</groupId>
            <artifactId>phantomjsdriver</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- Selenium's HtmlUnit-driver for Geb -->
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-htmlunit-driver</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- Spock specification framework -->
        <dependency>
            <groupId>org.spockframework</groupId>
            <artifactId>spock-core</artifactId>
        </dependency>

        <!-- Geb testing framework -->
        <dependency>
            <groupId>org.gebish</groupId>
            <artifactId>geb-core</artifactId>
        </dependency>
        <!-- integration of Geb and Spock -->
        <dependency>
            <groupId>org.gebish</groupId>
            <artifactId>geb-spock</artifactId>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>web-flow</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <argLine>${surefire.jvm.args}</argLine>
                            <failIfNoTests>false</failIfNoTests>
                            <includes>
                                <include>**/*WebFlow.java</include>
                            </includes>
                            <excludes>
                                <exclude>**/*Test.java</exclude>
                                <exclude>**/*Spec.java</exclude>
                                <exclude>**/*Specification.java</exclude>
                            </excludes>
                            <systemProperties>
                                <geb.build.baseUrl>http://acquitygroup01.alliance-prtnr-na01.dw.demandware.net/on/demandware.store/Sites-SiteGenesis-Site/</geb.build.baseUrl>
                                <geb.build.reportsDir>target/test-reports/geb</geb.build.reportsDir>
                                <webdriver.chrome.driver>${path.to.webdriver}</webdriver.chrome.driver>
                            </systemProperties>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>jrebel</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.zeroturnaround</groupId>
                        <artifactId>jrebel-maven-plugin</artifactId>
                        <version>1.1.3</version>
                        <executions>
                            <execution>
                                <id>generate-rebel-xml</id>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>