cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache CXF Documentation > Using CXF with maven
Date Thu, 03 Sep 2009 20:49:00 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=CXF20DOC&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
     <h2><a href="http://cwiki.apache.org/confluence/display/CXF20DOC/Using+CXF+with+maven">Using
CXF with maven</a></h2>
     <h4>Page <b>edited</b> by             <a href="http://cwiki.apache.org/confluence/display/~christian%2Bschneider">Christian
Schneider</a>
    </h4>
     
          <br/>
     <div class="notificationGreySide">
         <h1><a name="UsingCXFwithmaven-MavenPOMInformation"></a>Maven POM
Information</h1>

<p>To use CXF within Maven, you'll need to declare the CXF dependencies in your POM.
The CXF groupId is "org.apache.cxf". Here is a small example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">

<span class="code-tag">&lt;properties&gt;</span>
  <span class="code-tag">&lt;cxf.version&gt;</span>2.2.3<span class="code-tag">&lt;/cxf.version&gt;</span>
<span class="code-tag">&lt;properties&gt;</span>

<span class="code-tag">&lt;dependencies&gt;</span>
	<span class="code-tag">&lt;dependency&gt;</span>
		<span class="code-tag">&lt;groupId&gt;</span>org.apache.cxf<span
class="code-tag">&lt;/groupId&gt;</span>
		<span class="code-tag">&lt;artifactId&gt;</span>cxf-rt-frontend-jaxws<span
class="code-tag">&lt;/artifactId&gt;</span>
		<span class="code-tag">&lt;version&gt;</span>${cxf.version}<span
class="code-tag">&lt;/version&gt;</span>
	<span class="code-tag">&lt;/dependency&gt;</span>
	<span class="code-tag">&lt;dependency&gt;</span>
		<span class="code-tag">&lt;groupId&gt;</span>org.apache.cxf<span
class="code-tag">&lt;/groupId&gt;</span>
		<span class="code-tag">&lt;artifactId&gt;</span>cxf-rt-transports-http<span
class="code-tag">&lt;/artifactId&gt;</span>
		<span class="code-tag">&lt;version&gt;</span>${cxf.version}<span
class="code-tag">&lt;/version&gt;</span>
	<span class="code-tag">&lt;/dependency&gt;</span>
        <span class="code-tag"><span class="code-comment">&lt;!-- Jetty is
needed if you're are not using the CXFServlet --&gt;</span></span>
	<span class="code-tag">&lt;dependency&gt;</span>
		<span class="code-tag">&lt;groupId&gt;</span>org.apache.cxf<span
class="code-tag">&lt;/groupId&gt;</span>
		<span class="code-tag">&lt;artifactId&gt;</span>cxf-rt-transports-http-jetty<span
class="code-tag">&lt;/artifactId&gt;</span>
		<span class="code-tag">&lt;version&gt;</span>${cxf.version}<span
class="code-tag">&lt;/version&gt;</span>
	<span class="code-tag">&lt;/dependency&gt;</span>
<span class="code-tag">&lt;/dependencies&gt;</span>
</pre>
</div></div>

<p>For CXF 2.0.6 and later versions, you don't need to specify any repositories as the
artifacts are available in the central repository. For information on using Maven with CXF
and Tomcat, this <a href="http://www.jroller.com/gmazza/entry/creating_a_wsdl_first_web1"
rel="nofollow">blog entry</a> may be helpful.</p>

<h4><a name="UsingCXFwithmaven-AdditionalDependencies"></a>Additional Dependencies</h4>

<p>Depending on your usage of CXF, you may need to bring in additional dependencies--the
mvn install process will usually make clear what you are missing.  Here's a non-exhaustive
list of additional CXF artifacts that may be needed:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
&lt;!-- Use dependency blocks <span class="code-keyword">for</span> these
CXF artifact Ids just as above --&gt;
cxf-rt-core
cxf-rt-frontend-simple
cxf-rt-frontend-jaxws
cxf-rt-databinding-aegis
cxf-rt-transports-local
cxf-rt-transports-http
cxf-rt-transports-http-jetty
cxf-rt-transports-jms
cxf-rt-management
cxf-common-utilities
</pre>
</div></div> 


<h4><a name="UsingCXFwithmaven-MavenSnapshotRepository"></a>Maven Snapshot
Repository</h4>

<p>To work with the latest non-release versions of CXF (not recommended for production
use), <a href="http://www.nabble.com/CXF-snapshot-location-has-changed.-td22460813.html#a22460813"
rel="nofollow">updated nightly</a>, change the CXF version to the -SNAPSHOT version
desired and add the Apache snapshot repository to both the repositories and pluginRepositories
sections:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
&lt;repositories&gt;
   ...other repos...
   &lt;repository&gt;
      &lt;id&gt;apache-snapshots&lt;/id&gt;
      &lt;name&gt;Apache SNAPSHOT Repository&lt;/name&gt;
      &lt;url&gt;http:<span class="code-comment">//repository.apache.org/snapshots/&lt;/url&gt;
</span>      &lt;snapshots&gt;
         &lt;enabled&gt;<span class="code-keyword">true</span>&lt;/enabled&gt;
      &lt;/snapshots&gt;
   &lt;/repository&gt;
&lt;/respositories&gt;

&lt;pluginRepositories&gt;
   ...other repos...
   &lt;pluginRepository&gt;
      ...same repo as above...
   &lt;/pluginRepository&gt;
&lt;/pluginRepositories&gt;
</pre>
</div></div>

<p>The addition to the plugin repositories section is needed because the cxf-codegen-plugin,
used for the WSDL2Java, Java2WS, etc. tasks, is downloaded using that entry.</p>
     </div>
     <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>

       <a href="http://cwiki.apache.org/confluence/display/CXF20DOC/Using+CXF+with+maven">View
Online</a>
       |
       <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=49555&revisedVersion=27&originalVersion=26">View
Change</a>
              |
       <a href="http://cwiki.apache.org/confluence/display/CXF20DOC/Using+CXF+with+maven?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message