SlideShare a Scribd company logo
1 of 31
Download to read offline
Getting Grails into the
Enterprise
How to talk your favorite technology into
your company and keep it there
Created by /Ryan Vanderwerf @RyanVanderwerf
About Me
Chief Architect @ ReachForce
Co-Chair Austin Groovy and Grails User Group
Help maintain Grails Quartz plugin
Maintain GVPS Plugin (Grails Video Pseudo Streamer)
Maintain Struts-1 Plugin
Submit pull requests for others when I can!
What We Will Cover
How to Get Grails In The Door
My Story With Grails
Tips to help create a plan to start a project or introduce Grails in
your company
Tips to convince management or project managers
Tips for selecting a candidate application
Deploying a plugin to a maven repository / Artifactory
A little tour of Jenkins
Plugins to help keep things running smoothly
Plugins to help you get started and get Grails 'in the door' such
as using an old Struts 1.x application
How to Get Grails In The Door
Looking to introduce Grails into your Company or Enterprise? Make sure
you can answer these questions:
Do you have a plan? (Please work with one ors will hurt)i.e. why?
How will you sell it to management? (What's the upside? Risk?)
How will you know it is effective? (Have a way to benchmark
efficacy)
How will you keep things running smoothly? (Call on your trusty
plugins!)
What is a good kind of low-risk project to migrate? (This varies,
I'll show a struts example)
My Story with Grails
Old employer had very antiquated Struts/OJB application
Because of technical debt work orders from customers were taking
too long to do to be profitable Wanted a fresh start, but could not
afford
Wanted a fresh start, but could not afford to re-write all old code
Need a framework that allows for rapid development
Need a solution that Java developers can quickly grasp and
understand (and enjoy!)
Can be deployed to existing infrastructure as a WAR file
Barriers You May Encounter
Barriers to entry from non-technical staff or managers:
Fear of change
Skepticism it can deliver
A little different way of thinking to leverage Grails strengths like
scaffolding
Patience: People will resist it if it doesn't give immediate magical
results, so don't promise them
Difficult for project managers to understand defining the domain
model up front saves time later (i.e. regenerating scaffolding
repeatedly loses saved time)
Difficult for project managers/managers to understand why putting
work into scaffolding templates up front saves time and money going
forward (new process)
Picking A Legacy Application
It is important to pick a good legacy app candidate for introduction
Greenfield projects are always easier but can be risky if you are new
to the framework – Start with some kind of internal tool
Old Struts 1.x projects can be blended easily without a lot of risk
Easy win because people will have low expectations on such an old
application
Write unit tests for existing code in Groovy to 'wet' developer
appetites (and practice)
Creating A Plan
You must have a plan before you begin - responsible thing to do
How you will pick an app? old or new?
cost - how much will it cost if you need outside help?
who - how many resources do you need? Any IT changes necessary?
Are you superiors and peers sold on it yet? Did you do a POC?
It's about business value, this is the language your management will
speak. That may be the only information that actually comprehend -
compute some basic numbers to help
Selling to Management
You must have a plan before you begin - responsible thing to do
Gain development efficiencies, no constant server restarts during
development
Plugin ecosystem – won't have to re-invent the wheel so many great
useful plugins to save time (and most of the source, you can
contribute most of them to make them better)
Easy for Java developers to understand (See 'Making Java Groovy by
Ken Kousen')
Still deploys as a WAR file to the container, no significant
infrastructure changes
Can build a hybrid product to bridge the gap between new a old,
giving a long term plan to modernize as you go
Great community support
Facilities You Will Need To Put
In Place
You'll need some of these infrastructure items
CI Server – Hudson/Jenkins most popular free choice, works great with
Grails
setup jobs on CI Server to run tests - also add code analysis like
codenarc/gmetric
trigger builds by watching SCM for changes
use coverage tools like Cobertura or Emma
use code analysis tools like FindBugs or CodeNarc
Make your CI server fun, little things like the chuck norris plugin or
integration game keep developers entergized and interested (A
little competition for a prize never hurts!)
Use a service like Cloudbees if you can't run it yourself
Some kind of deployment tool. Roll your own in Grails, or use artifact
deployers in Hudson, or tools like Cargo, Chef, Puppet, Ansible, Docker
to help you
Struts 1 Plugin
You'd be shocked how many big places still heavily use Struts 1!
Lets you merge Struts applications into a Grails application
Often overlooked option that works quite well to get Grails 'in the
door' to help aging applications
You can even write Struts actions in Groovy
Easy win to run old legacy code and new Grails functionality in parallel
If you still use Grails 1.3.x use plugin v1.3.10. For Grails 2.x, use 1.3.11+
Struts 1 Plugin
Handle exceptions well for legacy code. In Grails 1.3.x, exceptions on a
500 server error page in your legacy application will be wrapped in a
Grails stack. This will frequently cause blame on Grails for legacy bugs
and give opponents ammunition to not go forward with Grails. Stack
traces in Grails 2 are much cleaner and also avoid this error
(If using Grails 2.x plugin version 1.3.11, the plugin does this for you)
If Using Grails 2, the ControllerActionProxy (TODO to fix this)
multipartResolver(org.codehaus.grails.struts.StrutsAwareMultipartResolver){
strutsActionExtension=".do"
}
Struts 1 Plugin
Demo
Flex / BlazeDS Plugin
Another one I've run into before.. you can use this plugin Burt Beckwith
wrote a while back
Lets you blend Grails, Struts, and Spring Security
I've run into quite a few of these 'quick' apps that were quick fixes that
won't die
Anything to externalize properties better, often I've seen people hard-
code into flash files properties (yuk!)
Has not been updated in a few years, may have issues with Grails 2.3+
Flex / BlazeDS Plugin
Another one I've run into before.. you can use this plugin Burt Beckwith
wrote a while back
Lets you blend Grails, Struts, and Spring Security
I've run into quite a few of these 'quick' apps that were quick fixes that
won't die - could be another easy vector in
Anything to externalize properties better, often I've seen people hard-
code into flash files properties (yuk!)
Has a nice user guide and docs thanks to Burt
Has not been updated in a few years, may have issues with Grails 2.3+
Google GWT
Another good candidate - may not be best for super complex projects
Let's you combine a GWT project with Grails
I have a GWT legacy app, this would be a good candidate if you have
one to get Grails in the door
1.0 status, less than 6 months since last update
If you can find a reason to ditch that horrific GWT maven script for
compilation, that alone is a win
Has several maintainers including Peter Ledbrook :) and a good
tutorial and documentation
There is also a SmartGWT plugin but 2 years since last update
Continuous Integration Server
Do you have a server to run it on? If yes, you have lots of options:
Jenkins / Hudson (recommended for Grails)
Cruise Control
Continuum
Team City
Travis
Bamboo
Continuous Integration Server
If no there are cloud based options:
Cloudbees
drone.io
CircleCi
CodeShip
Travis
Elastic Bamboo
Run your own instance of Jenkins/Hudson on a EC2 or other cloud
provider OS image (and maintain yourself)
Continuous Integration Server
Jenkins is by far the most popular now according to Rebellabs
Artifact / Maven Server
JFrog Artifactory the most popular and easy. Archiva etc also work fine
Database Reverse Engineering
2 Common Options to generate domain model from Database
Grails Reverse Engineering Plugin (Only works properly on a
separate 1.3.x project due to Hibernate version issues)
The GRails Application Generator (GRAG) Standalone application
Mirror domain objects to legacy tables is key to implementing new
features in Grails and leaving legacy code alone (If you won't have
hbm files to import to Grails)
Mirror domain objects to legacy tables is key to implementing new
features in Grails and leaving legacy code alone (If you won't have
hbm files to import to Grails)
When you have a domain object and a legacy bean make sure you
handle cache consistency when writing objects
Database Management
Database change management
Use Grails Database Migration Plugin (wraps Liquibase)
Liquibase Directly
Most other plugins like liquibase and autobase are deprecated in
favor of the Database Migration Plugin
Your DBAs may already have a process and procedure - you may
not win this one
Do NOT use the 'dbCreate' option in Grails for any kind of production
system – it is not smart enough to handle field renaming of columns
If using the Grails Database Migration Plugin, use the
changelog.groovy format and not the xml format, due to bugs in the
functionality that handles xml changelogs in the plugin
If you must use the xml format, use Liquibase directly
Create separate project and install the migration plugin just for it (Due
to Hibernate 3 vs 4 versioning issues)
Modularity
Split up major functional areas of the legacy applications into
separate plugins, but keep some things in mind:
JSPs do not serve well from plugins, start with just the java code,
then work your way to converting JSPs to GSPs called from the
plugins
Beware of cyclic dependencies, Grails does not tolerate them
(Good design should avoid this, but sometimes it's hard to break of
legacy spaghetti code)
Do not use the lib folder for jar files, keep dependencies clean....
Dependency Management
When migrating legacy app to Grails format, and you use Ant and not
Maven, follow these tips:
Don't just copy jars into the grails/lib folder, set up dependencies in
BuildConfig.groovy as much as possible(If no repo, use Bintray or
Artifactory)
Run dependency-report to help work out conflicts
Do not use the lib folder for jar files, keep dependencies clean....
If your legacy project is Maven based, Grails 2.1 has excellent Maven
support built in via 'grails create-pom' command (POM demo struts-
demo21)
Maven Project Management
Grails 2.1+ required: grails create-pom
Uses created pom.xml to build and manage dependencies instead of
BuildConfig.groovy
Advantage is easier for developers used to pure Maven build and
depenency management instead of Ivy
Very new so there may be dragons ahead, but so far works well
Could work around some build/packaging bugs on Ivy (Concurrent
building, etc)
Available goals by default: validate, initialize, generate-sources,
process-sources, generate-resources, process-resources, compile,
process-classes, generate-test-sources, process-test-sources,
generate-test-resources, process-test-resources, test-compile,
process-test-classes, test, prepare-package, package, pre-integration-
test, integration-test, post-integration-test, verify, install, deploy, pre-
clean, clean, post-clean, pre-site, site, post-site, site-deploy
Maven Project Management
Multi-module support (From docs):
create-multi-project-build
grailscreate-appmyapp
grailscreate-pluginplugin-a
grailscreate-pluginplugin-b
grailscreate-multi-project-buildcom.mycompany:parent:1.0-S
NAPSHOT
mvninstall
Release Plugin
Used to push plugins to maven repository (or your own plugins to the public!
Add the following to your BuildConfig.groovy:
grails.project.repos.default="PluginSnapShots"
grails.project.repos.PluginSnapShots.url="http://127.0.0.1:8081/artifactory/plugins-sna
pshot-local"
grails.project.repos.PluginSnapShots.type="maven"
grails.project.repos.PluginSnapShots.username="admin"
grails.project.repos.PluginSnapShots.password="password"
Localization Plugin
Store your i18n message bundles in the database
Can Import legacy i18n property files from most systems
Provides Caching
allows changes to labels on the app without a new build
Store your i18n message bundles in the database
Lets non-technical users fill in missing labels for you(and a value add
to sell when switching to Grails)
Combine with the filterpane plugin to add searching ability
Filterpane Plugin
Great for adding search ability for larger number of legacy reverse
engineered domain objects (and rows within those)
Simple to install and implement: add a new action to your controller
and add some parameters to your list view page
Clustering
Ehcache or new Spring Cache
Use your servlet containers http session clustering or use Terracotta
Use Terracotta open source edition for visibility and cache
management of level2 and general cache management
Hazelcast is also a great option for distributed cache
Useful resources
http://grails.org/plugin/filterpane
http://grails.org/plugin/localizations
http://grag.sourceforge.net/http://grails-
plugins.github.com/grails-database-migration/
http://grails.org/plugin/struts1
https://github.com/rvanderwerf/grails-struts1
http://terracotta.org/downloads/open-source/catalog
http://grails.org/plugin/release
http://grails.org/plugin/db-reverse-engineer
http://grails-plugins.github.io/grails-flex/

More Related Content

More from GR8Conf

More from GR8Conf (20)

Mum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developerMum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developer
 
Metaprogramming with Groovy
Metaprogramming with GroovyMetaprogramming with Groovy
Metaprogramming with Groovy
 
Scraping with Geb
Scraping with GebScraping with Geb
Scraping with Geb
 
How to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and AndroidHow to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and Android
 
Ratpack On the Docks
Ratpack On the DocksRatpack On the Docks
Ratpack On the Docks
 
Groovy Powered Clean Code
Groovy Powered Clean CodeGroovy Powered Clean Code
Groovy Powered Clean Code
 
Cut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature pluginsCut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature plugins
 
Performance tuning Grails applications
 Performance tuning Grails applications Performance tuning Grails applications
Performance tuning Grails applications
 
Ratpack and Grails 3
 Ratpack and Grails 3 Ratpack and Grails 3
Ratpack and Grails 3
 
Grails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloudGrails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloud
 
Functional testing your Grails app with GEB
Functional testing your Grails app with GEBFunctional testing your Grails app with GEB
Functional testing your Grails app with GEB
 
The Grails introduction workshop
The Grails introduction workshopThe Grails introduction workshop
The Grails introduction workshop
 
The Groovy Ecosystem Revisited
The Groovy Ecosystem RevisitedThe Groovy Ecosystem Revisited
The Groovy Ecosystem Revisited
 
Groovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examplesGroovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examples
 
Integration using Apache Camel and Groovy
Integration using Apache Camel and GroovyIntegration using Apache Camel and Groovy
Integration using Apache Camel and Groovy
 
CRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineCRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual Machine
 
Grooscript gr8conf
Grooscript gr8confGrooscript gr8conf
Grooscript gr8conf
 
CRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineCRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual Machine
 
Jan reher may 2013
Jan reher may 2013Jan reher may 2013
Jan reher may 2013
 
Good Form - complex web forms made Groovy
Good Form - complex web forms made GroovyGood Form - complex web forms made Groovy
Good Form - complex web forms made Groovy
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 

Getting Groovy and Grails into the Enterprise

  • 1. Getting Grails into the Enterprise How to talk your favorite technology into your company and keep it there Created by /Ryan Vanderwerf @RyanVanderwerf
  • 2. About Me Chief Architect @ ReachForce Co-Chair Austin Groovy and Grails User Group Help maintain Grails Quartz plugin Maintain GVPS Plugin (Grails Video Pseudo Streamer) Maintain Struts-1 Plugin Submit pull requests for others when I can!
  • 3. What We Will Cover How to Get Grails In The Door My Story With Grails Tips to help create a plan to start a project or introduce Grails in your company Tips to convince management or project managers Tips for selecting a candidate application Deploying a plugin to a maven repository / Artifactory A little tour of Jenkins Plugins to help keep things running smoothly Plugins to help you get started and get Grails 'in the door' such as using an old Struts 1.x application
  • 4. How to Get Grails In The Door Looking to introduce Grails into your Company or Enterprise? Make sure you can answer these questions: Do you have a plan? (Please work with one ors will hurt)i.e. why? How will you sell it to management? (What's the upside? Risk?) How will you know it is effective? (Have a way to benchmark efficacy) How will you keep things running smoothly? (Call on your trusty plugins!) What is a good kind of low-risk project to migrate? (This varies, I'll show a struts example)
  • 5. My Story with Grails Old employer had very antiquated Struts/OJB application Because of technical debt work orders from customers were taking too long to do to be profitable Wanted a fresh start, but could not afford Wanted a fresh start, but could not afford to re-write all old code Need a framework that allows for rapid development Need a solution that Java developers can quickly grasp and understand (and enjoy!) Can be deployed to existing infrastructure as a WAR file
  • 6. Barriers You May Encounter Barriers to entry from non-technical staff or managers: Fear of change Skepticism it can deliver A little different way of thinking to leverage Grails strengths like scaffolding Patience: People will resist it if it doesn't give immediate magical results, so don't promise them Difficult for project managers to understand defining the domain model up front saves time later (i.e. regenerating scaffolding repeatedly loses saved time) Difficult for project managers/managers to understand why putting work into scaffolding templates up front saves time and money going forward (new process)
  • 7. Picking A Legacy Application It is important to pick a good legacy app candidate for introduction Greenfield projects are always easier but can be risky if you are new to the framework – Start with some kind of internal tool Old Struts 1.x projects can be blended easily without a lot of risk Easy win because people will have low expectations on such an old application Write unit tests for existing code in Groovy to 'wet' developer appetites (and practice)
  • 8. Creating A Plan You must have a plan before you begin - responsible thing to do How you will pick an app? old or new? cost - how much will it cost if you need outside help? who - how many resources do you need? Any IT changes necessary? Are you superiors and peers sold on it yet? Did you do a POC? It's about business value, this is the language your management will speak. That may be the only information that actually comprehend - compute some basic numbers to help
  • 9. Selling to Management You must have a plan before you begin - responsible thing to do Gain development efficiencies, no constant server restarts during development Plugin ecosystem – won't have to re-invent the wheel so many great useful plugins to save time (and most of the source, you can contribute most of them to make them better) Easy for Java developers to understand (See 'Making Java Groovy by Ken Kousen') Still deploys as a WAR file to the container, no significant infrastructure changes Can build a hybrid product to bridge the gap between new a old, giving a long term plan to modernize as you go Great community support
  • 10. Facilities You Will Need To Put In Place You'll need some of these infrastructure items CI Server – Hudson/Jenkins most popular free choice, works great with Grails setup jobs on CI Server to run tests - also add code analysis like codenarc/gmetric trigger builds by watching SCM for changes use coverage tools like Cobertura or Emma use code analysis tools like FindBugs or CodeNarc Make your CI server fun, little things like the chuck norris plugin or integration game keep developers entergized and interested (A little competition for a prize never hurts!) Use a service like Cloudbees if you can't run it yourself Some kind of deployment tool. Roll your own in Grails, or use artifact deployers in Hudson, or tools like Cargo, Chef, Puppet, Ansible, Docker to help you
  • 11. Struts 1 Plugin You'd be shocked how many big places still heavily use Struts 1! Lets you merge Struts applications into a Grails application Often overlooked option that works quite well to get Grails 'in the door' to help aging applications You can even write Struts actions in Groovy Easy win to run old legacy code and new Grails functionality in parallel If you still use Grails 1.3.x use plugin v1.3.10. For Grails 2.x, use 1.3.11+
  • 12. Struts 1 Plugin Handle exceptions well for legacy code. In Grails 1.3.x, exceptions on a 500 server error page in your legacy application will be wrapped in a Grails stack. This will frequently cause blame on Grails for legacy bugs and give opponents ammunition to not go forward with Grails. Stack traces in Grails 2 are much cleaner and also avoid this error (If using Grails 2.x plugin version 1.3.11, the plugin does this for you) If Using Grails 2, the ControllerActionProxy (TODO to fix this) multipartResolver(org.codehaus.grails.struts.StrutsAwareMultipartResolver){ strutsActionExtension=".do" }
  • 14. Flex / BlazeDS Plugin Another one I've run into before.. you can use this plugin Burt Beckwith wrote a while back Lets you blend Grails, Struts, and Spring Security I've run into quite a few of these 'quick' apps that were quick fixes that won't die Anything to externalize properties better, often I've seen people hard- code into flash files properties (yuk!) Has not been updated in a few years, may have issues with Grails 2.3+
  • 15. Flex / BlazeDS Plugin Another one I've run into before.. you can use this plugin Burt Beckwith wrote a while back Lets you blend Grails, Struts, and Spring Security I've run into quite a few of these 'quick' apps that were quick fixes that won't die - could be another easy vector in Anything to externalize properties better, often I've seen people hard- code into flash files properties (yuk!) Has a nice user guide and docs thanks to Burt Has not been updated in a few years, may have issues with Grails 2.3+
  • 16. Google GWT Another good candidate - may not be best for super complex projects Let's you combine a GWT project with Grails I have a GWT legacy app, this would be a good candidate if you have one to get Grails in the door 1.0 status, less than 6 months since last update If you can find a reason to ditch that horrific GWT maven script for compilation, that alone is a win Has several maintainers including Peter Ledbrook :) and a good tutorial and documentation There is also a SmartGWT plugin but 2 years since last update
  • 17. Continuous Integration Server Do you have a server to run it on? If yes, you have lots of options: Jenkins / Hudson (recommended for Grails) Cruise Control Continuum Team City Travis Bamboo
  • 18. Continuous Integration Server If no there are cloud based options: Cloudbees drone.io CircleCi CodeShip Travis Elastic Bamboo Run your own instance of Jenkins/Hudson on a EC2 or other cloud provider OS image (and maintain yourself)
  • 19. Continuous Integration Server Jenkins is by far the most popular now according to Rebellabs
  • 20. Artifact / Maven Server JFrog Artifactory the most popular and easy. Archiva etc also work fine
  • 21. Database Reverse Engineering 2 Common Options to generate domain model from Database Grails Reverse Engineering Plugin (Only works properly on a separate 1.3.x project due to Hibernate version issues) The GRails Application Generator (GRAG) Standalone application Mirror domain objects to legacy tables is key to implementing new features in Grails and leaving legacy code alone (If you won't have hbm files to import to Grails) Mirror domain objects to legacy tables is key to implementing new features in Grails and leaving legacy code alone (If you won't have hbm files to import to Grails) When you have a domain object and a legacy bean make sure you handle cache consistency when writing objects
  • 22. Database Management Database change management Use Grails Database Migration Plugin (wraps Liquibase) Liquibase Directly Most other plugins like liquibase and autobase are deprecated in favor of the Database Migration Plugin Your DBAs may already have a process and procedure - you may not win this one Do NOT use the 'dbCreate' option in Grails for any kind of production system – it is not smart enough to handle field renaming of columns If using the Grails Database Migration Plugin, use the changelog.groovy format and not the xml format, due to bugs in the functionality that handles xml changelogs in the plugin If you must use the xml format, use Liquibase directly Create separate project and install the migration plugin just for it (Due to Hibernate 3 vs 4 versioning issues)
  • 23. Modularity Split up major functional areas of the legacy applications into separate plugins, but keep some things in mind: JSPs do not serve well from plugins, start with just the java code, then work your way to converting JSPs to GSPs called from the plugins Beware of cyclic dependencies, Grails does not tolerate them (Good design should avoid this, but sometimes it's hard to break of legacy spaghetti code) Do not use the lib folder for jar files, keep dependencies clean....
  • 24. Dependency Management When migrating legacy app to Grails format, and you use Ant and not Maven, follow these tips: Don't just copy jars into the grails/lib folder, set up dependencies in BuildConfig.groovy as much as possible(If no repo, use Bintray or Artifactory) Run dependency-report to help work out conflicts Do not use the lib folder for jar files, keep dependencies clean.... If your legacy project is Maven based, Grails 2.1 has excellent Maven support built in via 'grails create-pom' command (POM demo struts- demo21)
  • 25. Maven Project Management Grails 2.1+ required: grails create-pom Uses created pom.xml to build and manage dependencies instead of BuildConfig.groovy Advantage is easier for developers used to pure Maven build and depenency management instead of Ivy Very new so there may be dragons ahead, but so far works well Could work around some build/packaging bugs on Ivy (Concurrent building, etc) Available goals by default: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration- test, integration-test, post-integration-test, verify, install, deploy, pre- clean, clean, post-clean, pre-site, site, post-site, site-deploy
  • 26. Maven Project Management Multi-module support (From docs): create-multi-project-build grailscreate-appmyapp grailscreate-pluginplugin-a grailscreate-pluginplugin-b grailscreate-multi-project-buildcom.mycompany:parent:1.0-S NAPSHOT mvninstall
  • 27. Release Plugin Used to push plugins to maven repository (or your own plugins to the public! Add the following to your BuildConfig.groovy: grails.project.repos.default="PluginSnapShots" grails.project.repos.PluginSnapShots.url="http://127.0.0.1:8081/artifactory/plugins-sna pshot-local" grails.project.repos.PluginSnapShots.type="maven" grails.project.repos.PluginSnapShots.username="admin" grails.project.repos.PluginSnapShots.password="password"
  • 28. Localization Plugin Store your i18n message bundles in the database Can Import legacy i18n property files from most systems Provides Caching allows changes to labels on the app without a new build Store your i18n message bundles in the database Lets non-technical users fill in missing labels for you(and a value add to sell when switching to Grails) Combine with the filterpane plugin to add searching ability
  • 29. Filterpane Plugin Great for adding search ability for larger number of legacy reverse engineered domain objects (and rows within those) Simple to install and implement: add a new action to your controller and add some parameters to your list view page
  • 30. Clustering Ehcache or new Spring Cache Use your servlet containers http session clustering or use Terracotta Use Terracotta open source edition for visibility and cache management of level2 and general cache management Hazelcast is also a great option for distributed cache