Skip to content

Latest commit

 

History

History
240 lines (192 loc) · 7.55 KB

Integration.md

File metadata and controls

240 lines (192 loc) · 7.55 KB
layout title
master
Integration

Integration

Check out how to integrate GPars into your projects.

Grape

Integration using Grape is very straightforward:

@Grab(group='org.codehaus.gpars', module='gpars', version='1.2.1')

Snapshots

@GrabResolver(name='gpars', root='http://snapshots.repository.codehaus.org/', m2Compatible=true)
@Grab(group='org.codehaus.gpars', module='gpars', version='1.3-SNAPSHOT')

Grape config (optional)

GPars optionally relies on a couple of third-party libraries. Most of them reside in the central maven repository, however, since since the Netty lib resides in the jboss repository only, to leverage the (prototype) remoting capabilities, you either need to use the GrabResolver annotation (in Groovy 1.7):

@GrabResolver(name='jboss', root='http://repository.jboss.org/maven2/')

or make sure your grapeConfig.xml file contains all the necessary maven repositories:

Gradle

GPars is stored in the central maven repository at http://repo1.maven.org/maven2/org/codehaus/gpars/ and also in the Codehaus maven repository at http://repository.codehaus.org/org/codehaus/gpars/gpars/ . To include GPars in your project add either of the following repositories and also the dependency into your project:

repositories {
    mavenCentral()
    //add repositories for optional dependencies
    mavenRepo urls: ['http://repository.jboss.org/maven2/']
}

dependencies {
    compile "org.codehaus.gpars:gpars:1.2.1"
}

Snapshots

repositories {
    mavenRepo urls: ["http://snapshots.repository.codehaus.org/"]
    //add repositories for optional dependencies
    mavenRepo urls: ['http://repository.jboss.org/maven2/']
}
dependencies {
    compile "org.codehaus.gpars:gpars:1.3-SNAPSHOT"
}

Maven

To include GPars in your project add the following (optional) repositories and dependencies into your project:

<repositories>
    <repository>
        <id>jboss</id>
        <url>http://repository.jboss.org/maven2/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>org.codehaus.gpars</groupId>
        <artifactId>gpars</artifactId>
        <version>1.2.1</version>
    </dependency>
</dependencies>

Sample maven-based Java API demo project

You may also like a stand-alone maven-based Java API sample project showing how to use GPars from Java and how to integrate GPars with Maven.

And the same [sample project](http://bamboo.ci.codehaus.org/browse/GPARS- DEF/latest/artifact) is available for the SNAPSHOT release.

<repositories>
    <repository>
        <id>jboss</id>
        <url>http://repository.jboss.org/maven2/</url>
    </repository>
    <repository>
        <id>codehaus.snapshots</id>
        <url>http://snapshots.repository.codehaus.org</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>org.codehaus.gpars</groupId>
        <artifactId>gpars</artifactId>
        <version>1.3-SNAPSHOT</version>
    </dependency>
</dependencies>

Snapshots

Grails

Grails since 1.2

Leveraging the build in dependency management you can instad installing the plugins update the BuildConfig.groovy file accordingly:

repositories {
    mavenCentral()
    //  mavenRepo 'http://snapshots.repository.codehaus.org'  //enable if using GPars snapshots
    mavenRepo 'http://repository.jboss.org/maven2/'
}
dependencies {
    build 'org.codehaus.gpars:gpars:1.2.1'
}

Griffon

Using the Griffon built-in dependency management:

griffon.project.dependency.resolution = {
    inherits "global"

    default dependencies
        repositories {
            griffonHome()
            mavenCentral()
        }
        dependencies {
            runtime org.codehaus.gpars:gpars:1.2.1
        }
    }
}

You may also consider using the plugins to enable GPars for older Griffon versions.

Dependencies

GPars itself depends on a couple of libraries from the maven central repository. Check out the GPars public pom:

4.0.0 org.codehaus.gpars gpars 1.2.1 GPars The Groovy and Java high-level concurrency library offering actors, dataflow, CSP, agents, parallel collections, fork/join and more http://gpars.codehaus.org 2009 The Apache Software License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0.txt repo

  <dependency>
    <groupId>org.multiverse</groupId>
    <artifactId>multiverse-core</artifactId>
    <version>0.7.0</version>
    <scope>compile</scope>
  </dependency>

  <dependency>
    <groupId>org.codehaus.jcsp</groupId>
    <artifactId>jcsp</artifactId>
    <version>1.1-rc5</version>
    <scope>compile</scope>
    <optional>true</optional>
  </dependency>

  <dependency>
    <groupId>org.codehaus.jsr166-mirror</groupId>
    <artifactId>jsr166y</artifactId>
    <version>1.7.0</version>
    <scope>compile</scope>
  </dependency>

  <dependency>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy-all</artifactId>
    <version>2.1.9</version>
    <scope>compile</scope>
    <optional>true</optional>
  </dependency>

  <dependency>
    <groupId>org.jboss.netty</groupId>
    <artifactId>netty</artifactId>
    <version>3.2.9.Final</version>
    <scope>compile</scope>
    <optional>true</optional>
  </dependency>
</dependencies>

License

Licensed under APL 2.0 - License