Mark Derricutt's Disturbing Thoughts

My Top Tags

                                       

My Jaiku

Dealing With Bad Apples

Sunday, 20 July 2008 7:26 A GMT+12

Open source saves another marriage

Saturday, 19 July 2008 4:49 P GMT+12

Dark Fortress – Catacrusis

Saturday, 19 July 2008 3:14 P GMT+12

(Untitled)

Saturday, 19 July 2008 10:09 A GMT+12

Code Coverage as a "Static Debugger"

Saturday, 19 July 2008 6:46 A GMT+12

Dimmu Borgir – Absolute Sole Right

Friday, 18 July 2008 2:17 P GMT+12

Wooji Juice: Stage Hand Support

Thursday, 17 July 2008 3:12 P GMT+12

Lion's Share – Cult Of Denial

Thursday, 17 July 2008 1:36 P GMT+12

The Ultimate Software Gold Plating

Thursday, 17 July 2008 5:06 A GMT+12

Search Box

 

Maven Based Deployments

posted Sunday, 3 February 2008

For the last few weeks I've been working part time on a small project using Apache Maven as its build tool and this time round I'm finding Maven doesn't suck as much I thought the first time I encountered it. Sure this is a small project, but Maven shines in making, and keeping simple things simple.

Take for example automated deployments for a dev server - something the Rails/Django folk often tout as being one of their big advantages, and something I've often had issues with under other projects. Using the maven jetty plugin I'm finding I get pretty much the same functionality (update from Subversion, build, deploy, use):

[amrk@stumpy nceatracker]$ svn update ; mvn jetty:run
U  src/main/java/com/nceatracker/components/progressbar/ProgressBar.css
U  src/main/java/com/nceatracker/components/progressbar/ProgressBar.html
U  src/main/java/com/nceatracker/core/ServiceLayerImpl.java
A  src/main/java/com/nceatracker/core/InvalidUserException.java
U  src/main/java/com/nceatracker/core/ServiceLayer.java
U  src/main/java/com/nceatracker/pages/LoginPage.java
U  src/main/java/com/nceatracker/pages/ViewSubjectPage.html
U  src/main/java/com/nceatracker/pages/ViewSubjectPage.java
Updated to revision 38.
Listening for transport dt_socket at address: 5005
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'jetty'.
[INFO] ------------------------------------------------------------------------
[INFO] Building nceatracker
[INFO]    task-segment: [jetty:run]
[INFO] ------------------------------------------------------------------------
[INFO] Preparing jetty:run
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
Compiling 5 source files to /home/amrk/code/nceatracker/target/classes
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [jetty:run]
[INFO] Configuring Jetty for project: nceatracker

I'm currently running this from a screen session, and when I want to update the system to the latest code I can just CTRL-C it, once I add in my database migration framework I'll be all set for that next release.

It may not be as instantaneous or 'live' as you can get with the dynamic platforms, but is sure is bringing us Java folk one step closer. Going another step it's easy to get Jetty monitor the application every N seconds for changes and automatically redeploy, so all I then need is a subversion commit hook to update, and build the checked out version.

Maven continues to have its warts, but Maven also continues to bring builds to that next level of goodness.

tags:      

links: digg this    del.icio.us    technorati    reddit




1. Tim O'Brien left...
Sunday, 11 May 2008 8:36 am :: http://www.sonatype.com/book

Thanks for the feedback, one of Maven's persistent warts is lack of good documentation, we're trying to make a dent at http://www.sonatype.com/book

We'd be really happy if you gave us any feedback on the book, it is going to print soon.