• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Spring roo custom add-ons

Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can author please provide more details ? what are custom stuff that we can build ?
Posts: 63
Mac OS X Spring Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All of Roo is an add-on. For example, the tree of projects in Roo's source code are all of the add-ons that make up the base Roo commands:

I highly encourage everyone to download the source from GitHub:

either do a git clone https://github.com/SpringSource/spring-roo.git or download the zip. Then open up some of the addon-* folders and plunk around. It's really a neat way to build a tool, but basically add-ons can be triggered two ways at least:

1) react to changes in files / events
2) execute commands issued in the Roo shell

To expose shell commands, your add-on will have a Commands class that extends CommandMarker. Each command you expose is annotated with @CliCommand - then you can set parameters, etc.

Roo add-ons are just OSGi Java code, and generally you'll do one of several things:

1. add/update/remove an .aj file (AspectJ ITD)
2. generate Java source files (but not update once generated, that's a basic rule)
3. manipulate configuration files
4. manipulate the build (pom.xml) file

So, think of Roo like a really smart project configurator that is completely pluggable and customizable, and that comes with a base set of configuration to build Spring applications. You can extend it to do anything you want.

I have four add-ons I'm building now over at http://www.rimple.com/silly-weasel-forge/ as a way to teach others to write add-ons. I'm not perfect at it yet, and have run into some interesting problems, which I've documented on the blog at rimple.com. The book has two chapters to get you started as well. They are:
- jqueryui addon (installs jQuery and jQuery UI and inserts them in load-scripts.jspx).
- site addon - configures maven's site reporting. Eventually I'll parameterize the reports and configuration
- coffeescript addon - configures a Maven coffeescript compiler that gets executed during the compile phase
- spock add-on - my favorite at the moment - lets you write Groovy Spock BDD tests against your Roo application - I'm using it to write tests against add-ons, since they aren't Spring code but OSGi Java code and need a simple test mechanism.

A wop bop a lu bop a womp bam boom! Tiny ad:
a bit of art, as a gift, that will fit in a stocking
    Bookmark Topic Watch Topic
  • New Topic