Home > Groovy, Maven > Using Groovy++ with Maven – an update

Using Groovy++ with Maven – an update

In his comment to “Using Groovy++ with Maven” Joern Schimmelpfeng has correctly pointed out about transitive dependencies that may be added to groovypp POM, eliminating the need to specify them explicitly.

He’s right! That’s what we have Maven dependencies mechanism for.

It is now fixed so you can use

<dependency>
    <groupid>org.mbte.groovypp</groupid>
    <artifactid>groovypp-all</artifactid>
    <version>0.2.0</version>
</dependency>

or

<dependency>
    <groupid>org.mbte.groovypp</groupid>
    <artifactid>groovypp</artifactid>
    <version>0.2.0</version>
</dependency>

Full examples:

Now it looks practically the same – what’s the difference then?

As previously, groovypp-all.jar contains all required libraries, repackaged in one jar:

In addition to groovy ("groovy", "org.codehaus.groovy" packages) and groovypp ("org.mbte.groovypp" package) it also contains antlr, asm, commons-cli and junit libraries, some of which are stored under modified package names to avoid collisions with libraries that may be available already in your project.

groovypp.jar is bound to all above libraries in separate jars, as declared by its <dependencies>.

Which one to choose then?

  • If your application has already declared <dependency> on either antlr or asm and you
       don’t like them packaged twice (note, even in this case – there are no collisions due to
       packages modified), then you can choose the groovypp version.
     
       It usually works better in IDEA project as it doesn’t recognize "groovypp-all" jar as
       Groovy and tries to search for it elsewhere.
     
       Note: sometimes you may need to add an explicit junit:4.7 dependency, otherwise
       Maven brings old 3.8.2 JUnit version lacking classes required for Groovy++ compilation.
       It can be seen in groovypp example above, see the diff of switching from "groovypp-all"
       to "groovypp".
     
  • If you just want to just use Groovy++ without dealing with JUnit versions and you
       experience no Groovy-related IDEA problems – you can use groovypp-all.
Advertisements
Categories: Groovy, Maven Tags: , , ,
  1. No comments yet.
  1. March 22, 2010 at 01:18
  2. June 26, 2010 at 13:37

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: