Get Your Hands on Griffon 0.9!

DZone 's Guide to

Get Your Hands on Griffon 0.9!

· Java Zone ·
Free Resource

An early snapshot of Griffon 0.9 went live today and is available for your downloading pleasure. This will be the fifth major release of the Grails-like application framework for building desktop apps in Groovy.  Some exciting new features include packaging enhancements, infrastructure updates, application archetypes, improved testing, and command line updates.


The last version of Griffon was numbered 0.3.1, but the major advancements in this next release merited a larger leap in version number.  Griffon 0.9 will upgrade its infrastructure to support Groovy 1.7.3, JUnit 4, and synchronize its codebase with Grails 1.3.2.  The 0.9 infrastructure allows the configuration of secure plugin repositories and there is a new file available that allows you to configure different aspects of the Griffon build including output paths and servers used for resolution of plugins.  Also, you'll find that the invocation order of build event handlers now honors the dependency order of the plugin that provides them.

Command Line

Two of the new command line features are inspired by Gradle.  The first is a common expansion ability which allows a command target to be expanded if you write in shortened notation using camel case.  This ought to save you plenty of keystrokes.  The second is a command wrapper (griffonw) that downloads, installs and runs a fully working Griffon distribution.  Another new features is an algorithm that kicks in if a command target is not recognized, even if the previous command expansion feature did not resolve to a known script.  This prevents you from accidentally invoking the griffon command with the wrong target.

Application Archetypes

Application Archetypes provide a solution for artifact templates that could not configure how an application is created.  These archetypes provide a hook into the application process by :

    •    Providing new versions of existing templates, like Model, Controller, etc.
    •    Creating new directories and files
    •    Installing a preset of plugins

These archetypes were inspired by Maven.  Here's how the default archetype descriptor ( application.groovy) looks:
import griffon.util.Metadata

includeTargets << griffonScript("_GriffonPlugins")
includeTargets << griffonScript("_GriffonInit")
includeTargets << griffonScript("CreateMvc" )

target(createApplicationProject: 'Creates a new application project') {

// to install plugins do the following
// Metadata md = Metadata.getInstance("${basedir}/application.properties")
// installPluginExternal md, pluginName, pluginVersion
// pluginVersion is optional

Testing Upgrades

Griffon 0.9 tests can be run using the same phase:type mechanism found in Grails 1.3.2.  Griffon has three phases (unit, integration, and other) and two default types (unit and integration).  There will also be four other direct ports of Grails plugins for Griffon: Code-Coverage, Clover, CodeNarc, and GMetrics.


Plugins have gotten some major upgrades in Griffon 0.9.  During plugin packaging, new jars can be generated that contain groovydocs generated for all sources, compiled test sources, and more.  There's also a new installer plugin that provides extra installer/launcher targets such as izpack, rpm, deb, mac, and windows.
Andres Almiray, the founding member and project lead of the Griffon framework, has written five wonderful blogs on these five different aspects of the 0.9 release.  Check them out for the finer details. 

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}