(Quick Reference)

2.1 Downloading and Installing - Reference Documentation

Authors: The Whole GPars Gang

Version: 1.0-SNAPSHOT

2.1 Downloading and Installing

GPars is now distributed as standard with Groovy. So if you have a Groovy installation, you should have GPars already. The exact version of GPars you have will, of course, depend of which version of Groovy. If you don't already have GPars, and you do have Groovy, then perhaps you should upgrade your Groovy!

If you do not have a Groovy installation, but get Groovy by using dependencies or just having the groovy-all artifact, then you will need to get GPars. Also if you want to use a version of GPars different from the one with Groovy, or have an old GPars-less Groovy you cannot upgrade, you will need to get GPars. The ways of getting GPars are:

  • Download the artifact from a repository and add it and all the transitive dependencies manually.
  • Specify a dependency in Gradle, Maven, or Ivy (or Gant, or Ant) build files.
  • Use Grapes (especially useful for Groovy scripts).

If you're building a Grails or a Griffon application, you can use the appropriate plugins to fetch the jar files for you.

The GPars Artifact

As noted above GPars is now distributed as standard with Groovy. If however, you have to manage this dependency manually, the GPars artifact is in the main Maven repository and in the Codehaus main and snapshots repositories. The current release version (0.12) is in the Maven and Codehaus main repositories, the current development version (1.0-SNAPSHOT) is in the Codehaus snapshots repository. To use from Gradle or Grapes use the specification:

"org.codehaus.gpars:gpars:0.12"
for the release version, and:
"org.codehaus.gpars:gpars:1.0-SNAPSHOT"
for the development version. You will likely need to add the Codehaus snapshots repository manually to the search list in this latter case. Using Maven the dependency is:
<dependency>
    <groupId>org.codehaus.gpars</groupId>
    <artifactId>gpars</artifactId>
    <version>0.12</version>
</dependency>
or version 1.0-SNAPSHOT if using the latest snapshot.

Transitive Dependencies

GPars requires that two dependencies, namely jsr166y and extra166y (artifacts from the JSR-166 Project ), be on the classpath for GPars using programs to compile and execute. Release versions of these artifacts are in the main Maven and Codehaus repositories. Development versions of the artifacts are available in the Codehaus snapshots repository. Using Gradle or Grapes you would use dependency specifications:

"org.codehaus.jsr166-mirror:jsr166y:1.7.0"
"org.codehaus.jsr166-mirror:extra166y:1.7.0"
For Maven, the specification would be:
<dependency>
    <groupId>org.codehaus.jsr166-mirror</groupId>
    <artifactId>jsr166y</artifactId>
    <version>1.7.0</version>
</dependency>
<dependency>
    <groupId>org.codehaus.jsr166-mirror</groupId>
    <artifactId>extra166y</artifactId>
    <version>1.7.0</version>
</dependency>
The development versions have version number 1.7.0.1-SNAPSHOT.

GPars defines both of these dependencies in its own descriptor, so adding them in should be taken care of automatically if you use Gradle, Maven, Ivy or other type of automatic dependency resolution tool.

Please visit the page Integration on the GPars website for more details.