Add dependency to your project

There are two ways of adding dependencies to your project, as discussed in chapter 4. You can manually add dependencies or you can add the dependency to the POM file (then it will be automatically downloaded).


If you decide to manually add the dependency to the project, then you have to download the library from the following location:

How to do it

Add manual the Hamcrest dependency to the project:

  1. Download the Java bindings, since we are using Java to create our scripts. \ (Url:
  2. Create a (new) folder under the just created project and give it a meaningful name, like libs (as it will contain the project libraries). Right-click project -> new -> Folder


  1. Copy hamcrest-all.jar to libs.
  2. Select the hamcrest dependency in libs, right-click on them, and select Build Path > Add to Build Path. Now, the dependencies are added to Referenced Libraries.


Use maven to manage the Hamcrest dependency

Another option is to put it directly in the pom.xml file.

  1. Right-click on the project and select Maven -> Add Dependency. A popup window will appear.
  2. Enter hamcrest-all in the searchfield.
  3. Select the latest version of hamcrest-all and click on OK.

Just put the follow snippet between the <dependencies>...</dependencies> tags.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.