If I was actually doing this at work, and was being nit-picky, I would suggest moving this out into it's own util. I'm surprised there isn't something already in maven that does this already?