cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Kulp (Confluence)" <conflue...@apache.org>
Subject [CONF] Apache CXF > Setting up Eclipse
Date Tue, 25 Jun 2013 20:12:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/en/2176/1/15/_/styles/combined.css?spaceKey=CXF&amp;forWysiwyg=true"
type="text/css">
    </head>
<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="https://cwiki.apache.org/confluence/display/CXF/Setting+up+Eclipse">Setting
up Eclipse</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~dkulp">Daniel
Kulp</a>
    </h4>
        <br/>
                         <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" > <br>\\ <br></td></tr>
            <tr><td class="diff-changed-lines" >{panel} (i) While there exist
Maven plug-ins for Eclipse, team developer experience has found using them with CXF [problematic|http://cxf.547215.n5.nabble.com/Using-the-Eclipse-Maven-plugin-for-CXF-tp575175p575176.html]
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 [CXF <span
class="diff-changed-words">build|<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">http://cwiki.apache.org/confluence/display/CXF/</span>Building]</span>
page.{panel} <br></td></tr>
            <tr><td class="diff-unchanged" > <br>h4. To install the plugins:
<br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <p>Setting up an <a href="http://www.eclipse.org/downloads/" class="external-link"
rel="nofollow">Eclipse</a> 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>
<ul>
	<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="http://eclipse-cs.sourceforge.net/update"
class="external-link" rel="nofollow">http://eclipse-cs.sourceforge.net/update</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="http://pmd.sourceforge.net/eclipse"
class="external-link" rel="nofollow">http://pmd.sourceforge.net/eclipse</a></li>
	<li>Subversion plugins - there are a couple of these to enable Subversion checkins/checkouts
from within eclipse: <a href="http://subclipse.tigris.org/update_1.4.x" class="external-link"
rel="nofollow">http://subclipse.tigris.org/update_1.4.x</a></li>
</ul>


<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="http://cxf.547215.n5.nabble.com/Using-the-Eclipse-Maven-plugin-for-CXF-tp575175p575176.html"
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="/confluence/display/CXF/Building"
title="Building">CXF build</a> page.</p>
</div></div> 

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


<ul>
	<li>Click "Available Software Sites" and add the three remote sites listed above. 
Select just those three.</li>
	<li>Back on the Install window, select "Work With: -<del>All Available Sites</del>-,
and choose the three plugins listed above.</li>
	<li>Return to "Available Software Sites" and reactivate the other remote sites (for
subsequent updates/installs).</li>
</ul>


<p>Eclipse will then download and install those plugins.</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/display/CXF/cxf-m2eclipse"
title="cxf-m2eclipse">this page</a> for instructions.</p>

<h3><a name="SettingupEclipse-Creatingaworkspace"></a>Creating a workspace</h3>
<p>First <a href="http://cxf.apache.org/source-repository.html" 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="http://cxf.apache.org/building.html" class="external-link" rel="nofollow">build
page</a> for more detailed information):</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>&gt; mvn -Pfastinstall
&gt; mvn -Psetup.eclipse  
</pre>
</div></div>
<p><b>OR</b></p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>&gt; mvn install -Pfastinstall -Psetup.eclipse
</pre>
</div></div>
<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
panelContent">
<pre>"mvn -Psetup.eclipse -Declipse.workspace.dir=path/to/workspace"
</pre>
</div></div>

<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
panelContent">
<pre>"mvn -Psetup.eclipse -Pset.eclipse.output"
</pre>
</div></div>

<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>
<ul>
	<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
panelContent">
<pre>File -&gt; Import....
</pre>
</div></div></li>
	<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>
</ul>


<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>

<ol>
	<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="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family:
ConfluenceInstalledFont,monospace;">
...
    &lt;activeProfiles&gt;
        &lt;activeProfile&gt;extra&lt;/activeProfile&gt;
    &lt;/activeProfiles&gt;
    &lt;profiles&gt;
        &lt;profile&gt;
            &lt;id&gt;extra&lt;/id&gt;
            &lt;properties&gt;
                &lt;eclipse.workspace&gt;/home/dkulp/working/workspace&lt;/eclipse.workspace&gt;

                &lt;eclipse.workspace.dir&gt;/home/dkulp/working/workspace&lt;/eclipse.workspace.dir&gt;
            &lt;/properties&gt;
        &lt;/profile&gt;
    &lt;/profiles&gt;
...
</pre>
</div></div>
<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>
</ol>


<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>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;" class="grey">
                        <a href="https://cwiki.apache.org/confluence/users/removespacenotification.action?spaceKey=CXF">Stop
watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://cwiki.apache.org/confluence/users/editmyemailsettings.action">Change
email notification preferences</a>
</div>
        <a href="https://cwiki.apache.org/confluence/display/CXF/Setting+up+Eclipse">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=20273&revisedVersion=20&originalVersion=19">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/CXF/Setting+up+Eclipse?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message