All Projects → klieber → Phantomjs Maven Plugin

klieber / Phantomjs Maven Plugin

Licence: mit
A maven plugin for installing the phantomjs binary on your system automatically.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Phantomjs Maven Plugin

Manet
Website screenshot service powered by Node.js, SlimerJS and PhantomJS
Stars: ✭ 570 (+819.35%)
Mutual labels:  phantomjs
Jcabi Dynamodb Maven Plugin
DynamoDB Local Maven Plugin
Stars: ✭ 26 (-58.06%)
Mutual labels:  maven-plugin
Rpm Maven Plugin
Stars: ✭ 52 (-16.13%)
Mutual labels:  maven-plugin
Jsonschema2pojo
Generate Java types from JSON or JSON Schema and annotate those types for data-binding with Jackson, Gson, etc
Stars: ✭ 5,633 (+8985.48%)
Mutual labels:  maven-plugin
Graphql Java Codegen Maven Plugin
Maven plugin for graphql-java-codegen
Stars: ✭ 17 (-72.58%)
Mutual labels:  maven-plugin
Phantomjs
Scriptable Headless Browser
Stars: ✭ 28,654 (+46116.13%)
Mutual labels:  phantomjs
Crack Geetest
滑动验证码破解示例,仅供学习使用。
Stars: ✭ 539 (+769.35%)
Mutual labels:  phantomjs
Wish
常用javaweb技术,不定期更新,欢迎讨论。
Stars: ✭ 60 (-3.23%)
Mutual labels:  phantomjs
Appcrawler
Android应用市场网络爬虫
Stars: ✭ 25 (-59.68%)
Mutual labels:  phantomjs
Serverless Html Pdf
Convert HTML to PDF thru a lambda function using PhantomJS.
Stars: ✭ 51 (-17.74%)
Mutual labels:  phantomjs
Typescript Generator
Generates TypeScript from Java - JSON declarations, REST service client
Stars: ✭ 729 (+1075.81%)
Mutual labels:  maven-plugin
Maven Min Plugin
📦 Latke application JavaScript and CSS files compression.
Stars: ✭ 5 (-91.94%)
Mutual labels:  maven-plugin
Lambda Packs
Precompiled packages for AWS Lambda
Stars: ✭ 997 (+1508.06%)
Mutual labels:  phantomjs
Quick Media
media(audio/image/qrcode/markdown/html/svg) support web service (多媒体编辑服务, 酷炫二维码, 音频, 图片, svg, markdown, html渲染服务支持)
Stars: ✭ 612 (+887.1%)
Mutual labels:  phantomjs
Buildplan Maven Plugin
A Maven 3.x plugin to inspect project lifecyle.
Stars: ✭ 57 (-8.06%)
Mutual labels:  maven-plugin
Groovy Eclipse
Eclipse Groovy Development Tools
Stars: ✭ 567 (+814.52%)
Mutual labels:  maven-plugin
Blazar
Pre-Render Pages on the Fly in Laravel
Stars: ✭ 14 (-77.42%)
Mutual labels:  phantomjs
Boj Autocommit
When you solve the problem of Baekjoon Online Judge, it automatically commits and pushes to the remote repository.
Stars: ✭ 60 (-3.23%)
Mutual labels:  phantomjs
Animal Sniffer
Stars: ✭ 59 (-4.84%)
Mutual labels:  maven-plugin
Aframe Phantomjs Continuous Streaming
Browse the web in VR by live streaming a web page into Aframe using PhantomJS and ffmpeg.
Stars: ✭ 40 (-35.48%)
Mutual labels:  phantomjs

phantomjs-maven-plugin

Build Status Coverage Status Maven Central Stories in Ready Flattr this git repo

A maven plugin for installing the phantomjs binary on your system automatically. You no longer need to have phantomjs pre-installed on your CI server or development workstation in order to use it as part of your build. Just add the following to your build:

<project>
  ...
  <!-- phantomjs-maven-plugin needs maven 3.1+ -->
  <prerequisites>
    <maven>3.1</maven>
  </prerequisites>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>com.github.klieber</groupId>
        <artifactId>phantomjs-maven-plugin</artifactId>
        <version>${phantomjs-maven-plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>install</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <version>1.9.7</version>
        </configuration>
      </plugin>
    </plugins>
 </build>
 ...
</projects>

The plugin also makes the property phantomjs.binary available after it installs phantomjs so that you can use it to configure other maven plugins that use phantomjs or so that it can be used in your JUnit testing.

Example using with jasmine-maven-plugin:

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>com.github.klieber</groupId>
        <artifactId>phantomjs-maven-plugin</artifactId>
        <version>${phantomjs-maven-plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>install</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <version>1.9.7</version>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.github.searls</groupId>
        <artifactId>jasmine-maven-plugin</artifactId>
        <version>${jasmine-maven-plugin-version}</version>
        <executions>
          <execution>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <webDriverClassName>org.openqa.selenium.phantomjs.PhantomJSDriver</webDriverClassName>
              <webDriverCapabilities>
                <capability>
                  <name>phantomjs.binary.path</name>
                  <value>${phantomjs.binary}</value>
                </capability>
              </webDriverCapabilities>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
 ...
</projects>

Example using in a JUnit test:

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>com.github.klieber</groupId>
        <artifactId>phantomjs-maven-plugin</artifactId>
        <version>${phantomjs-maven-plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>install</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <version>1.9.7</version>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.17</version>
        <configuration>
          <systemPropertyVariables>
            <phantomjs.binary>${phantomjs.binary}</phantomjs.binary>
          </systemPropertyVariables>
        </configuration>
      </plugin>
    </plugins>
  </build>
 ...
</projects>

Then your JUnit test can access it like this:

package org.example;

import org.junit.Test;
import java.io.File;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

public class ExampleTest {

  @Test
  public void shouldHavePhantomJsBinary() {
    String binary = System.getProperty("phantomjs.binary");
    assertNotNull(binary);
    assertTrue(new File(binary).exists());
  }

}

The plugin can also execute phantomjs scripts for you as well. The following downloads phantomjs automatically if it isn't already present on the system and then executes the script hello.js with the argument Bob (see full example here):

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>com.github.klieber</groupId>
        <artifactId>phantomjs-maven-plugin</artifactId>
        <version>${phantomjs-maven-plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>install</goal>
              <goal>exec</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <version>1.9.7</version>
          <checkSystemPath>true</checkSystemPath>
          <script>hello.js</script>
          <arguments>
            <argument>Bob</argument>
          </arguments>
        </configuration>
      </plugin>
    </plugins>
 </build>
 ...
</projects>

More documentation can be found on the plugin site: http://klieber.github.io/phantomjs-maven-plugin

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].