<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>
    <artifactId>oss-parent</artifactId>
    <groupId>org.sonatype.oss</groupId>
    <version>6</version>
  </parent>

  <groupId>com.github.seykron</groupId>
  <artifactId>htmlunit-maven-plugin</artifactId>
  <version>1.0</version>
  <packaging>maven-plugin</packaging>
  <name>htmlunit - Maven Plugin</name>
  <description>Maven plugin to load test files into HtmlUnit.</description>
  <url>https://github.com/seykron/htmlunit-maven-plugin</url>

  <developers>
    <developer>
      <id>seykron</id>
      <name>Matias MI</name>
      <email>seykron@gmail.com</email>
    </developer>
  </developers>

  <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>
    </license>
  </licenses>

  <scm>
    <url>https://github.com/seykron/htmlunit-maven-plugin</url>
    <connection>scm:git:https://github.com/seykron/htmlunit-maven-plugin.git</connection>
    <developerConnection>scm:git:https://github.com/seykron/htmlunit-maven-plugin.git</developerConnection>
  </scm>

  <!-- The location where deploy and site-deploy leaves the artifacts.
       repositoryRoot is defined in globant parent pom. This configuration is
       overriden in dev to skip this pom site. -->
  <distributionManagement>
	  <snapshotRepository>
		  <id>sonatype-nexus-snapshots</id>
		  <name>Sonatype Nexus snapshot repository</name>
		  <url>https://oss.sonatype.org/content/repositories/snapshots</url>
	  </snapshotRepository>
	  <repository>
		  <id>sonatype-nexus-staging</id>
		  <name>Sonatype Nexus release repository</name>
		  <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
	  </repository>
  </distributionManagement>

  <dependencies>
    <!-- Mojo Dependencies -->
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>2.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-project</artifactId>
      <version>2.2.1</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>2.2.1</version>
      <exclusions>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>jcl-over-slf4j</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-jdk14</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.maven.wagon</groupId>
          <artifactId>wagon-http-lightweight</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.maven.wagon</groupId>
          <artifactId>wagon-http</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.maven.wagon</groupId>
          <artifactId>wagon-webdav-jackrabbit</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- Plugin test deps -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.8.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.easymock</groupId>
      <artifactId>easymock</artifactId>
      <version>3.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-all</artifactId>
      <version>1.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-api-easymock</artifactId>
      <version>1.4.6</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-module-junit4</artifactId>
      <version>1.4.6</version>
      <scope>test</scope>
    </dependency>


    <!-- Plugin Dependencies -->
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-utils</artifactId>
      <version>3.0</version>
    </dependency>
    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
      <version>2.6</version>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.0.1</version>
    </dependency>
    <dependency>
      <groupId>xml-apis</groupId>
      <artifactId>xml-apis</artifactId>
      <version>1.4.01</version>
    </dependency>
    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-java</artifactId>
      <version>2.32.0</version>
      <exclusions>
        <exclusion>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging</artifactId>
        </exclusion>
        <exclusion>
          <groupId>xml-apis</groupId>
          <artifactId>xml-apis</artifactId>
        </exclusion>
        <exclusion>
          <groupId>xerces</groupId>
          <artifactId>xerces</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.antlr</groupId>
      <artifactId>stringtemplate</artifactId>
      <version>3.2.1</version>
    </dependency>
    <dependency>
      <groupId>javax.activation</groupId>
      <artifactId>activation</artifactId>
      <version>1.1.1</version>
    </dependency>

    <!-- Logging -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.5</version>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jul-to-slf4j</artifactId>
      <version>1.7.5</version>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jcl-over-slf4j</artifactId>
      <version>1.7.5</version>
    </dependency>

    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>1.0.1</version>
    </dependency>

    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <version>1.1.1</version>
      <scope>provided</scope>
    </dependency>

    <!-- JavaScript dependencies, only for integration tests -->
    <dependency>
      <groupId>org.webjars</groupId>
      <artifactId>jasmine</artifactId>
      <version>1.3.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.webjars</groupId>
      <artifactId>jasmine-jquery</artifactId>
      <version>1.4.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.webjars</groupId>
      <artifactId>jquery</artifactId>
      <version>1.6.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.webjars</groupId>
      <artifactId>jasmine-reporters</artifactId>
      <version>0.2.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>2.5.1</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.1.2</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>verify</phase>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Prepares and performs the release. This basically deploys the
      distribution package configured in the assembly-plugin.
      -->
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.2.2</version>
        <configuration>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <pushChanges>false</pushChanges>
          <localCheckout>true</localCheckout>
      		<arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <executions>
          <execution>
            <id>sign-artifacts</id>
            <phase>verify</phase>
            <goals>
              <goal>sign</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <keyname>B8D9574C</keyname>
          <passphrase>${gpg.passphrase}</passphrase>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>integration-tests</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.github.seykron</groupId>
            <artifactId>htmlunit-maven-plugin</artifactId>
            <version>${version}</version>
            <executions>
              <execution>
                <id>jasmine-tests</id>
                <phase>verify</phase>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <dependenciesClassLoader>true</dependenciesClassLoader>
              <testDependenciesClassLoader>true</testDependenciesClassLoader>
              <webClientConfiguration>
                <javaScriptEnabled>true</javaScriptEnabled>
              </webClientConfiguration>
              <runnerConfiguration>
                <outputDirectory>${project.build.directory}/htmlunit-tests</outputDirectory>
                <debugPort>9000</debugPort>
                <testRunnerTemplate>
                  file:${basedir}/src/test/resources/org/htmlunit/maven/JasmineTestRunner.html
                </testRunnerTemplate>
                <bootstrapScripts>
                  classpath:/META-INF/resources/webjars/jasmine/**/*.js;
                  classpath:/META-INF/resources/webjars/jasmine-reporters/**/*_reporter.js;
                  classpath:/META-INF/resources/webjars/jquery/**/*.min.js;
                  file:${basedir}/src/test/resources/**/Bootstrap.js
                </bootstrapScripts>
                <sourceScripts>
                  file:${basedir}/src/main/resources/**/*.js;
                </sourceScripts>
                <testFiles>
                  file:${basedir}/src/test/resources/**/*Test.js
                </testFiles>
              </runnerConfiguration>
              <systemProperties>
                <logback.configurationFile>${basedir}/src/test/resources/logback-runtime.xml</logback.configurationFile>
              </systemProperties>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>

