Fork me on GitHub

n. Slang a rough lawless young Kuali developer.
[perhaps variant of Houlihan, Irish surname]
kualiganism n

Blog of an rSmart Java Developer. Full of code examples, solutions, best practices, et al.

Saturday, December 7, 2013

New Maven Plugin! redis-maven-plugin

Overview

As many of you know, I've been implementing the Data Dictionary with a Redis backing store. It seems like an obvious move, right? Move the DD out of memory and into its own separate application? Good news is we're about ready to release! This isn't about though! This is about the redis-maven-plugin. While working on the Redis backing store, it occurred to me that a redis server that automagically started and ran embedded for integration tests would be a really really good thing. I looked around github, but couldn't find one at the time. This is the sad news. I didn't exactly know how to do it, so I asked for help. In asking for help, some other folks thought to give it a shot instead of joining my project. Now there are a few different versions out there. I still think this is the most complete though.

Examples

Here's how you can go about using it.

For Integration Tests


Just add the following plugin. The redis plugin is automatically attached to the pre-integration-test and post-integration-test phases.



Attaching to Another Phase


In case (for whatever reason), you don't want your redis server started/stopped with integration tests, here's how you would configure it.



Running Unforked


Sometimes there is a need to just crank up a redis server while you're running your project, but you're not running integration tests. For example, maybe you're running a tomcat7 instance of your application that requires an embedded redis server. We can do that! Or maybe you just need a quick redis server for whatever.

Add the following to your $HOME/.m2/settings.xml



Execute the following:

mvn redis-server:start-no-fork

Conclusion

That's it.

It's been awhile since I've posted on here. I'd like to give a "heads up" on blog posts I'm working on. These are in no particular order.

  • Signed Git Commits
  • Ducktyping Rice Web Services
  • Follow-up to Development environments with Vagrant
  • Multi-environment Log Management with Elasticsearch, Kibana, and Logstash
  • Developing with JRebel (KS, Rice, KC, and KFS)
  • Kuali Student and MySQL Setup
  • Writing Useful Logging and Performance Logging with Perf4J
  • Improvements on KS/KFS Archetypes

No comments:

Post a Comment