Paulo Poiati | Blog

GMongo available at Maven Central

A maintenance release (0.5.1) of GMongo was launched. It just fixed a bug with com.mongodb.DB#createCollection.

But the good news is the GMongo availability in the Maven Central (http://repo2.maven.org/maven2/).

Maven

<dependency>
      <groupId>com.gmongo</groupId>
      <artifactId>gmongo</artifactId>
      <version>0.5.1</version>
</dependency>

Ivy

<dependency org="com.gmongo" name="gmongo" rev="0.5.1"/>

Groovy Grape

// Grab the jar
@Grab(group='com.gmongo', module='gmongo', version='0.5.1')

This should compile and run seamlessly in an environment with Groovy 1.7.2 (or later):

// Grab the jar
@Grab(group='com.gmongo', module='gmongo', version='0.5.1')

import com.gmongo.GMongo

def mongo = new GMongo("127.0.0.1", 27017)
def db = mongo.getDB('myDb')

db.greetings.insert(hello: 'world')
comments powered by Disqus