Showing posts with label Maven. Show all posts
Showing posts with label Maven. Show all posts

Monday, January 26, 2009

Helpful Maven Build Tips

Brian Fox recently posted some great tips to improve your Maven builds. You should check them out if you haven't already. I've been doing most of what he said already but one really caught my attention, and I will repost here:

#6 Print Test Failures to Standard Output

Tip: Enable -Dsurefire.useFile=false. This is a favorite of mine since this causes surefire to print test failures to standard out, where it will get included in the build failure log and email. This saves you from having to dig back onto the machine to find the surefire report just to see a simple stack trace. (to enable globally in settings.xml:true in an active profile)


I can't believe I didn't know about this option before. Having to grep through surefire log files has really annoyed me in the past... many kudos to Brian for sharing this!

Tuesday, October 14, 2008

Repeatable Maven Builds

A typical problem folks have with Maven seems to be getting repeatable builds. If you've encountered this, you know the pain: an older release needs to be built but now fails with the dreaded "Failed to resolve artifact" error. You can't really depend on most Maven repos to be there indefinitely. I'm sure repos like http://repo1.maven.org are pretty safe but AFAIK the maintainers are under no legal obligation to keep around the artifacts forever. You most likely DO have obligations to customers and thus need to ensure builds are repeatable.

You get repeatability for free when you use a repository manager like Nexus - it keeps downloaded artifacts around forever by default. If you don't want to use a repository manager, you're going to have to save those artifacts some other (manual) way. One approach would be to just tar up your local m2 repo after each release and store it somewhere safe (like in SVN). Of course, since local repos tend to get huge over time, you should always start from an empty local repo before a release.

Hope this helps.

Tuesday, October 7, 2008

Why drop Maven?

Recently I've noticed projects dropping Maven in favour of some other build tool... Apache Qpid comes to mind in this case. I'm wondering, is there a real good technical reason that folks do not like Maven? It has its quirks... but really, what tool doesn't? I've been using it for years now and like it better that any other build tool out there.

Friday, September 19, 2008

Nexus indices added for FUSE

I've added Nexus repository indices for the FUSE Maven repositories. You can find instructions on how to add these to your m2eclipse installation here.

Why should you care? Well, among many other things, this enables you:

1. Create new projects based on Camel archetypes
2. Search for classes in all FUSE artifacts
3. Add FUSE dependencies to your project's POM

Wednesday, August 27, 2008

Nexus == easy

I must admit, the Maven setup at work has me a bit spoiled. Direct LAN access to a bunch of Maven mirrors makes for some pretty fast builds. Problem is, when I go off site I have to suffer through slow builds again...

Thanks to Bruce I now have wicked fast builds off site too!! A local instance of Nexus is the answer. Seriously, go take a look at the steps Bruce posted. It took me like 30 minutes to setup and add about twenty mirrors - now thats freakin' easy.

Heres the best part (I'm building Apache Camel here with a clean local repo):

No mirroring
[INFO] Total time: 31 minutes 18 seconds

Custom internal mirrors
[INFO] Total time: 7 minutes 52 seconds

Nexus mirroring
[INFO] Total time: 3 minutes 3 seconds

Anyway, bottom line is that I'm impressed. Great work Maven guys!