kelvin goodson wrote:
I share your pain! I have lost a lot of time trying to influence my
eclipse workspace to pay heed to the source in my workspace rather
than requiring source jars.  I too see a variety of eclipse dialogs to
locate source,  and recently it seems to prefer only letting me point
to source jars, so it is impossible to get the debugger to show my
local mods.

Kelvin.

I found a way to do this that works for me.  It was based on Simon's
suggestion to run mvn eclipse:eclipse from the top level so that the
Tuscany modules are included in the reactor when generating the eclipse
project files for the samples.

I had to adapt this slightly because I am generating Eclipse projects
from the contents of the binary distribution, which doesn't include
source for the Tuscany modules.  I copied a "hacked" pom.xml into the
root directory of the binary distribution which I had built within the
distribution folder of my svn working copy.  The relevant section of
the "hacked" pom.xml is:

    <modules>
        <module>../../../../modules</module>
        <module>samples</module>
        <module>tutorials</module>
        <module>demos</module>
    </modules>

The relative path ../../../../modules picks up the modules directory
from my working copy and combines that with the samples, tutorials and
demos directories in the binary distribution.  Running mvn eclipse:eclipse
against this pom generates all the Eclipse projects I need, with the correct
cross-dependencies and with "live" source code in the right place (not taken
from jar or zip files).  I can import these projects into Eclipse and
everything works as it should.  If I then update some Tuscany source code
in my svn working copy to fix a bug that I found when running a sample,
Eclipse will automatically pick up the updated Tuscany source code.

  Simon

On Thu, Sep 23, 2010 at 8:56 AM, Simon Laws <simonsl...@googlemail.com> wrote:
On Thu, Sep 23, 2010 at 8:37 AM, Simon Nash <n...@apache.org> wrote:
Simon Laws wrote:
I was talking offline to the other Simon about how to import existing
projects into Eclipse. Looking at the docs I realized that we talk
about how to use Eclipse when starting from scratch but don't say much
about how to use Eclipse with existing projects. I had a go at putting
some instructions together in 1.x [1]. If anyone has any suggesting
for improvements please feel free.

Once they settle down we can add/link similar info to the 2.x site.

[1]
http://tuscany.apache.org/import-existing-tuscany-sca-projects-into-eclipse.html

Simon

The maven-based instructions on this web page work fine for importing
the Tuscany SCA samples into Eclipse.  However I'm finding it difficult
to debug the Tuscany runtime with this setup.

The problem is that each imported sample project has a list of dependencies
pointing to tuscany-xxx jar files in my local maven repository (M2_REPO).
Eclipse doesn't know the location of the source code for these jar files,
so I can't view the source and set debug breakpoints within Tuscany
runtime code.

I found a very painful workaround by selecting one particular dependent
jar that I wanted to debug and doing an Eclipse source attachment for
that specific jar only.  This worked but I shudder at the thought of
having to repeat this manual source attachment for dozens of dependent
jars in dozens of samples.

Is there a simple convenient way to tell Eclipse that all the dependent
jars in the M2_REPO/org/apache/tuscany/sca/xxx path have their source in
the Tuscany source distribution zip file?

 Simon


This may not be that helpful in the context of using the Tuscany
source distribution but here's what I know about finding source in the
context of the Tuscany svn based source environment.

- Source jars. Our build produces source jars (with the sources
profile) and when you build with maven (without -o) they are
downloaded to your local repo automatically. Eclipse will pick them up
from there and show the source for you. There is a *big* downside here
though. The source jars are out of date all of the time. This is made
even worse as the Hudson build is not completing and so the source
jars are getting further and further out of sync. The problem is so
bad that I physically delete the source jars from my local repo
whenever they get downloaded as it makes it impossible to debug.

- Inclusion of Tuscany in the workspace. If you do mvn eclipse:eclipse
for all the Tuscany modules and you do this from the top level of the
Tuscany build then the inter module references will be to projects in
the workspace rather than to jars in the local repo. This is not the
case if you run mvn eclipse:eclipse in individual modules.

- Manual assignment of source. As I run in the PDE and am often
running samples outside the context of the Tuscany directory structure
I'm nearly always faced with the prospect of telling eclipse where the
Tuscany source is. It's seemingly random when and how eclipse asks for
this information, i.e. it has a selection of different dialogs that it
uses but I can't detect a pattern. Anyhow I find this mechanism pretty
convenient and, more important, predictable in terms of allowing me to
debug the Tuscany source at the right level. It's very easy to waste a
lot of time in Eclipse trying to work out why the lines you are
stepping through don't apparently match what's going on.

Simon



--
Apache Tuscany committer: tuscany.apache.org
Co-author of a book about Tuscany and SCA: tuscanyinaction.com




Reply via email to