Building CXF from Source
CXF uses Maven as its build and management tool.
Prequisites
Required:
- Download and install Maven.
(Maven 3.1 or better is required). - Get the latest code Source Repository
- Java 1.8 or better
...
Building CXF
Before building CXF, you need to setup an environment variable to give maven Maven more memory:
On Unix
Code Block |
---|
export MAVEN_OPTS="-Xmx512M"
|
On Windows
Code Block |
---|
set MAVEN_OPTS=-Xmx512M
|
On 64 bit Windows, or if you're obtaining out-of-memory, you may need to expand the memory requirements above further, to 768M.
Code Block |
---|
set MAVEN_OPTS=-Xmx768M
|
On 64bit platforms (64bit Linux and Solaris are known to require this), you also need to increase the PermGen spaceplatforms, or if you're obtaining out-of-memory errors, you may need to expand the memory requirements above further, to 768M. However, if you are using a recent version of Java6 (update 14 or later) with 64bit vm, you can use the UseCompressedOops to save memory. In that case, use:
Code Block |
---|
export MAVEN_OPTS="-Xmx512M -XX:MaxPermSize=128m -Xmx512M+UseCompressedOops" |
To build CXF simply execute (from within the cloned git directory):
Code Block |
---|
$ mvn install
|
Or, "mvn clean install" for subsequent runs. To build CXF without running checkstyle do:
Code Block |
---|
$ mvn -Pnochecks
|
To build CXF without running checkstyle or the tests do:
Code Block |
---|
$ mvn -Pfastinstall
|
Building releasable/testable kits
The "distribution" stuff is in the distribution module. After building all the stuff above, you can go into the distribution subdirectory and runTo build CXF and deploy the sources to your local maven repo do the following. If you build this way you can start your own cxf project from a pom file and import it with maven eclipse:eclipse then you will have all sources correctly linked into your eclipse project:
Code Block |
---|
$ mvn -Pfastinstall source:jar install |
Important: For subsequent builds (e.g., after code changes are made), run "mvn clean" first to build from scratch, before using one of the mvn install commands above. (You may also wish to run "svn update" after running mvn clean but before running mvn install.)
Building releasable/testable kits
The "distribution" stuff is in the distribution module. At and that will build both a src kit and a binary kit in target. Alternatively, top level, you can run:
Code Block |
---|
$ mvn install -Peverything
|
which will cause EVERYTHING to build in one shot.
Deploying snapshots
To deploy a snapshot (apache commiters only), run
Code Block |
---|
mvn -Pdeploy deploy
|
That will deploy the latest snapshot along with the javadoc and source jar bundles to apaches snapshot repository. After deploying the snapshot, you need to login to people.apache.org and fix the permissions. cd to /www/people.apache.org/repo/m2-snapshot-repositroy and run the fix-permissions.sh script.
Setting up Eclipse
To setup eclipse for CXF, you'll want to check to set up a separate directory /outside of your workspace/. Here is an example of how it might be done:
Code Block |
---|
[/home/joe]$ mkdir /home/dan/cxf
[/home/joe]$ cd cxf
[/home/joe/cxf]$ svn co https://svn.apache.org/repos/asf/incubator/cxf/trunk
[/home/joe/cxf]$ cd trunk
[/home/joe/cxf/trunk]$ mvn -Pfastinstall
[/home/joe/cxf/trunk]$ mvn -Psetup.eclipse
|
Once that is done, start up eclipse and set your workspace to "/home/joe/cxf/workspace". You'll then want to import all the CXF modules into eclipse. This can be done by doing:
- File->Import
- Select General->Existing Projects into Workspace
- Enter "/home/joe/cxf/trunk" as the root directory
- Click "Finish"
Performing a release
For the most part, we now follow the same instructions that the maven team uses.
http://maven.apache.org/developers/release/releasing.html
Basically, setup your settings.xml file as they described except for your gpg key. The version of the gpg plugin we use will ask for it. The deploy.altRepository should be set to something similar to:
Code Block |
---|
dkulp::default::scp://people.apache.org/home/dkulp/public_html/maven_staging
|
After that is setup, you should just need to run
Code Block |
---|
mvn release:prepare -Peverything
mvn release:perform
|
That will tag the release, update the poms, etc... Then build it (off the tag) and deploy everything (including source jars and javadoc jars) to the deploy.altRepository location and gpg signs everything. Once there, call the vote(s) based on that.
After the vote passes, you'll need to "merge" that staging location to the main location. Right now, this process takes a real maven Guru to do. The "stage" plugin that will handle this process has not yet been released. You need to checkout the maven-stage-plugin code and build it. However, it currently relies on some snapshots of other things that haven't been deployed. Thus, building the stage plugin can take some time. Best bet, have Dan Kulp do this until the plugin is released. If you DO get it built, you just need to run something like:
, including the distribution modules that are normally excluded. As of CXF 2.3.0, it also will build all the samples to make sure they are fully buildable. To speed it up, you can use the fastinstall profile with it:
Code Block |
---|
$ mvn install -Peverything,fastinstall
|
Setting up Eclipse
See this page for information on using the Eclipse IDE with the CXF source code.
Building with NetBeans
See this page for information on using the NetBeans IDE with the CXF source code.
Maven Repositories
If you use Maven for building your applications, Apache CXF artifacts are available from the following repository URLS:
Releases:
All supported CXF releases are synced into the maven central repository: http://repo1.maven.org/maven2/
Snapshots:
Snapshots are available in Apache's snapshot repository: http://repository.apache.org/snapshots
Note |
---|
Snapshot builds are relatively untested and unsupported and are provided for verification and testing purposes. |
Code Block |
mvn stage:copy \ -Dsource="http://people.apache.org/~dkulp/stage_cxf/2.0_incubator-RC_take1/maven" \ -Dtarget="scp://people.apache.org/www/people.apache.org/repo/m2-incubating-repository" \ -Dversion=2.0_incubator-RC |