The adventure of grails plugin creation

Grails is nice framework but production of real application can be difficult because the number of libraries and tools underline.

Goals

  • Share source code with my team
  • Distribute and maintain version though internal network
  • Test from plugin
  • Create a Grails 1.3.1 application from scratch and use it.

Technologies

Here, the list is important to know because grails has changed from 1.2 to 1.3.1. All my test are running with particular condition. Contrary to Java, groovy and grails are not as mature.

  • GWT 2.1
  • SmartGWT 2.2
  • Grails 1.3.1
  • Grails GWT Plugin 0.5
  • Java 6
  • Sun JVM Linux 32bits

My first plugin

Before creating any lines of my plugin, I want to share the code with my team. So, there are two way to maintain my plugin.

  1. The SVN repository enables to share source code.
  2. The maven repository permit artefact distribution.

http://www.grails.org/doc/latest/guide/12.%20Plug-ins.html#12.2%20Plugin%20Repositories

I put in place Nexus on my local version of tomcat 6.0.20. And I create a repository with “svnadmin” commands (Introduction to SVN).

SVN repository

Setup

If you want to set a project called smartgwt, add the following lines in BuildConfig.groovy :

grails.plugin.repos.distribution.arm="http://nadc-svn1.nadc.arm.com/svn/pipd/austinsw/SkunkWorks/Grail/plugins/"
grails.plugin.repos.discovery.arm="http://nadc-svn1.nadc.arm.com/svn/pipd/austinsw/SkunkWorks/Grails/plugins/"

Notes

  • Local repository cannot be :
    file:///work/SkunkWorks/plugin/repo

    . Only, HTTP and HTTPS protocol are supported.

  • Do not specify the name of the project and trunk directory because of grails will build the right directory for you. Grails likes convention over configuration idea.

Publish

To publish your plugin, you have to define the name of plugin.**

grails release-plugin -repository=arm

It works after 1hour.

Sources