I recently created some SOAP web service clients using Apache CXF (which is a project that resulted from the merging of XFire and Celtix). Rather than hunt down all the jar files I needed and write an Ant script to do the build, I decided to use Maven for this. It worked nicely and saved me some time (I can’t say the same for some of the more complex projects I’ve tried to use Maven with).
I found the following blog entry very useful for setting this up:
One thing I did different was use a property to specify the CXF version in one place:
Pay attention to what it says about the cxf.xml file. I used the Maven Eclipse Plugin to generate my Eclipse project files. If you do this, but forget the cxf.xml file, your client may still work fine in Eclipse, but when you try to use the Maven-built jar file, you will get an error like this:
So make sure to put the cxf.xml file in your src/main/resources folder (create that folder if it doesn’t exist).