Skip to content

Contributing to Crawljax code

Ali Mesbah edited this page May 16, 2013 · 2 revisions

Development

Requirements

  • Apache Maven version 3.0.3 or later to build and manage the dependencies of Crawljax.
  • Java 7
  • One of the webdriver supported web browsers installed.

Eclipse setup guides

If Eclipse is your preferred IDE you can follow these steps:

  1. clone crawljax from GitHub.
  2. Make sure you have the Maven Eclipse plugin installed from the Eclipse marketplace.
  3. In Eclipse, go to File > Import..., and choose Existing maven projects. Find the Crawljax directory you have cloned and select it for import. Crawljax is now a multi-module project, so select all the modules you need. The crawling engine is in the core module.

Testing

To run the tests you can use the regular Maven command to test:

mvn test

This will run all fast (browserless) unit tests.

To run all the tests, including the slower (browser-dependent) tests, run:

mvn test -P integrationtests

Documentation

Provide proper JavaDoc comments, especially for public methods.

  • Use mvn javadoc:javadoc to generate the JavaDoc API (generated in target/site/apidocs).

Formatting code

Format the code according to the eclipse-formatter.xml file in the root dir. To automatically format your code on each save in Eclipse:

  • Under Preferences, choose Java --> Editor --> Save Actions. Check the "Perform the selected actions on save", and check the "Format source code" box.

Pull request checklist:

  • All tests succeed,
  • you've used the code formatter to format all Java code,
  • clear description of the contribution,
  • every pull requests fixes/features one thing and one thing only. If you fixed multiple things, open multiple pull requests from different branches,
  • If you have too many commits, or commits with broken code etc. consider squashing the commits.

Deployment

Deployment Strategy

Crawljax related artifacts should be deployed to Maven repositories as follows: if all the third-party dependencies of an artifact are already available in Central, then the artifact should be deployed to Central as well via Sonatype. Make sure to carefully read their requirements and instructions.

This holds for releases as well as snapshots.

Releasing Parent POMs

The hierarchy of the poms in Crawljax is as follows:

Making a release

  1. Use the Maven release plugin.
  2. Once a release is made, the following items need to be updated: The latest release API need to be updated with target/checkout/target/apidocs