Skip to main content Skip to complementary content

CXF Maven Archetypes

About this task

Apache CXF provides a Maven archetype for creating Java-first web services. This section explores using it along with the Eclipse's m2eclipse plugin. Open Eclipse:

Procedure

  1. From the main menu, go to File > New > Other, and select Maven Project under the Maven category:

    Example

  2. Click Next to get the Select project name and location screen, accept its defaults, and click Next again to get to the Select an Archetype dialog.
  3. On this page, enter cxf in the Filter field, and select the item with group ID org.apache.cxf.archetype and artifact ID cxf-jaxws-javafirst:

    Example

    If the CXF archetype is not already available in your Eclipse installation, add it by selecting Add Archetype... with the following information:
    • Archetype Group Id: org.apache.cxf.archetype
    • Archetype Artifact Id: cxf-jaxws-javafirst
    • Archetype Version:
    • Repository URL: http://repo1.maven.org/maven2
  4. Then, Click Next. Fill the required fields as below:

    Example

  5. Click Finish, the project skeleton will be generated with a structure as below:

    Example

Results

The project skeleton is created and can be started, and you can add Java methods to represent the web service operations you want to implement. "HelloWorld.java" is the simple interface that this archetype generates, along with an ready-to-run implementation (HelloWorldImpl.java) of it. Both can be changed when implementing your own web service provider.

Since the CXF Maven archetype does not provide a test SOAP client or provide OSGi deployment capability, the next sections explain how to manually add in OSGi configuration as well as to use SoapUI to make SOAP calls.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!