cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [CONF] Apache CXF > Setting up Eclipse
Date Sat, 04 Dec 2010 21:37:00 GMT
    <base href="">
            <link rel="stylesheet" href="/confluence/s/1810/9/15/_/styles/combined.css?spaceKey=CXF&amp;forWysiwyg=true"
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="">Setting
up Eclipse</a></h2>
    <h4>Page <b>edited</b> by             <a href="">Benson
                         <h4>Changes (1)</h4>
<div id="page-diffs">
            <table class="diff" cellpadding="0" cellspacing="0">
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >It will then download them and install
them. <br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h3.
Experimental Alternative: M2Eclipse <br> <br>Some of us are starting to experiment
with using M2Eclipse. See [this page|cxf-m2eclipse] for instructions. <br> <br></td></tr>
            <tr><td class="diff-unchanged" >h3. Creating a workspace <br>First
[check out CXF|] from Subversion. <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
</div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <p>Setting up an Eclipse project to build CXF is pretty easy.   There are three
parts to it:</p>

<h3><a name="SettingupEclipse-Requiredplugins"></a>Required plugins</h3>
<p>We use several Eclipse plugins to make building CXF a bit easier</p>
	<li>Checkstyle - we use checkstyle to make sure we have consistent code style as well
as to find various types of bugs and other issues.  <a href=""
class="external-link" rel="nofollow"></a></li>
	<li>PMD - like Checkstyle, we use PMD to find potential programming problems in the
code.  Point the Eclipse auto-install thing at <a href=""
class="external-link" rel="nofollow"></a></li>
	<li>Subversion plugins - there are a couple of these to enable Subversion checkins/checkouts
from within eclipse: <a href="" class="external-link"

<p><br class="atl-forced-newline" /></p>
<div class="panel" style="border-width: 1px;"><div class="panelContent">
<p> <img class="emoticon" src="/confluence/images/icons/emoticons/information.gif"
height="16" width="16" align="absmiddle" alt="" border="0"/> While there exist Maven plug-ins
for Eclipse, team developer experience has found using them with CXF <a href=""
class="external-link" rel="nofollow">problematic</a> at best.  We recommend importing
the CXF source code as Eclipse projects as shown below and/or using Maven externally (i.e.,
from a command-line window) as discussed on the <a href=""
class="external-link" rel="nofollow">CXF build</a> page.</p>

<h4><a name="SettingupEclipse-Toinstalltheplugins%3A"></a>To install the
	<li>Go to
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
<pre>Help -&gt; Software updates -&gt; Find and install

	<li>Select "Search for new features to install" and hit Next</li>
	<li>For each of the above plugins, click on "New Remote Site", enter a name and the
above URL.</li>
	<li>Select the three new sites and click finish.   It will search for the new plugins.
 Select them all and hit OK.</li>

<p>It will then download them and install them.</p>

<h3><a name="SettingupEclipse-ExperimentalAlternative%3AM2Eclipse"></a>Experimental
Alternative: M2Eclipse</h3>

<p>Some of us are starting to experiment with using M2Eclipse. See <a href="/confluence/pages/createpage.action?spaceKey=CXF&amp;title=cxf-m2eclipse&amp;linkCreation=true&amp;fromPageId=20273"
class="createlink">this page</a> for instructions.</p>

<h3><a name="SettingupEclipse-Creatingaworkspace"></a>Creating a workspace</h3>
<p>First <a href="" class="external-link"
rel="nofollow">check out CXF</a> from Subversion.</p>

<p>To create a workspace, just run from the root directory of the CXF project (see the
<a href="" class="external-link" rel="nofollow">build
page</a> for more detailed information):</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
<pre>&gt; mvn -Pfastinstall
&gt; mvn -Psetup.eclipse  
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
<pre>&gt; mvn install -Pfastinstall -Psetup.eclipse
<p>This creates a new workspace in "../workspace" for use with CXF.  </p>

<p>If you don't want the workspace there, you can run: </p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
<pre>"mvn -Psetup.eclipse -Declipse.workspace.dir=path/to/workspace"

<p>If you don't want the eclipse projects' output directory to be ./target directory
(by default) but ./eclipse-classes, you can run:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
<pre>"mvn -Psetup.eclipse -Pset.eclipse.output"

<p>What this does is create a workspace and imports our checkstyle rules, the maven
2 repository, code format rules, import order rules, etc...  into that workspace.   It also
goes through each sub-project and creates the .project and .classpath files.  This process
will take some time.   It will down load source jars for most of the dependencies and hook
them up in the .classpath file as well.   Thus, while coding/debugging, you can trace right
into the dependent libraries.  While running, you <b><em>WILL</em></b>
see a bunch of warnings and such flying by.   There are a bunch of jars on ibiblio that do
NOT have source jars with them.   Thus, you will see warning about those.   Those warnings
are safely ignorable.   As long as it says "BUILD SUCCESSFUL" at the end, you should be OK.</p>

<h3><a name="SettingupEclipse-CreatetheprojectinEclipse"></a>Create the
project in Eclipse</h3>
	<li>In eclipse, switch to the workspace you created above.</li>
	<li>Go To:
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
<pre>File -&gt; Import....
	<li>Select "Existing Projects into Workspace" and hit Next</li>
	<li>Select root directory: enter the path to your trunk directory and hit Next.</li>
	<li>Select all the subprojects and hit Finish.  Eclipse will import and rebuild all
the subprojects selected.  This will take a while.</li>

<p>That's all there is to it.   From eclipse, all the unit tests and system tests should
be runnable.   However, to build kits/jars and stuff, you still need to use the command line
"mvn" stuff.</p>

<h4><a name="SettingupEclipse-ImportingnewprojectsthatdependonCXFprojects"></a>Importing
new projects that depend on CXF projects</h4>
<p>With the latest version (2.5) of the maven-eclipse-plugin, when you run "mvn eclipse:eclipse"
on a project, if it knows where your workspace is, it will see what projects are already defined
and wire them in to the new project instead of pointing at the jars in your ~/.m2/repository
dir.   Thus, debugging is a lot easier.   There are two ways to get it to know where your
workspace is:</p>

	<li>Explicitly on the command line.  When running eclipse:eclipse, add -Declipse.workspace=/home/dkulp/working/workspace</li>
	<li>Update your Maven ~/.m2/settings.xml to have a active profile that always sets
these variables. Thus, whenever the eclipse plugin looks for it, it know where the workspace
is.   In settings.xml, do:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">

<p>By doing that, you can pretty much run eclipse:eclipse (or -Psetup.eclipse for cxf
projects) at any point and it will always wire the new project to depend on the existing projects.</p></li>

<h3><a name="SettingupEclipse-HowDoesThisAllWork%2CAnyway%3F"></a>How Does
This All Work, Anyway?</h3>
<p>If you are wondering about how all this manages to make Eclipse, Maven, Checkstyle,
and PMD <br/>
cooperate, see <a href="/confluence/display/CXF/Connecting+Maven%2C+Eclipse%2C+Checkstyle%2C+and+PMD"
title="Connecting Maven, Eclipse, Checkstyle, and PMD">Connecting Maven, Eclipse, Checkstyle,
and PMD</a>.</p>

        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href=""
class="grey">Change Notification Preferences</a>
        <a href="">View
        <a href="">View
        <a href=";showCommentArea=true#addcomment">Add

View raw message