println it

Software blog about tools, builds and making it all work

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.

, , ,

One Response to “Using Groovy++ with Maven – an update”

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>