Apache CXF Eclipse Maven tutorial
In this tutorial, I am going to explain easiest way how to start developing web-services with Apache CXF using Maven as build manager on Eclipse IDE.
**UPDATE: here you can download parent-independent pom.xml for this project. (your project dont need to be in cxf working directory)
IDE: Eclipse Indigo (download link)
M2E (installation tutorial link)
CheckStyle (installation link – eclipse resource)
PMD (installation link – eclipse resource)
Source code management: GIT (installation tutorial link)
Build manager: Maven 3.0.3 (installation link)
Open your terminal and navigate to folder where you want to have cxf. Get apache cxf examples from the internet:
git clone git://git.apache.org/cxf.git
Go into cxf:
Build the examples without tests (taking too much time)
Note: You should run command above more times if necessary.
In this tutorial we are talking about startup with webservices, so we are going to use “wsdl_first” project from examples. We should navigate there. (I presume you are still in cxf folder)
We need to build maven for eclipse project with following command:
Open eclipse. Then open wizard on File -> Import -> Existing Maven Projects. Browse then for “cxf\distribution\src\main\release\samples\wsdl_first”. And if you see pom.xml (checked), click finish.
Now you can run example webservices in eclipse (with run option) or from the command line window with:
To start server:
To start client:
Start coding and enjoy
P.S. if you experience some problems while running the example project you should clean it:
Then go to the step 4 again.