You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Ralf Barkow <Ra...@web.de> on 2004/05/12 16:35:55 UTC

Re: Eclipse issue -- maven eclipse - David's bash loop

As David's bash loop didn't worked for me with Cygwin,
I post a modified version. Now I'm looking for a current
.launch file to be able to debug in ecplise. Anyone?

--- schnipp ---

#!/usr/bin/bash
for modules in "$(find ./*/ -name project.xml | sed 's/project.xml//')"; do
    echo $modules;
    for module in $modules
    do
      pushd $module &> /dev/null
      maven eclipse > /dev/null
      popd &> /dev/null
    done;
done;

--- schnapp ---

Regards,
-- 
/rgb 


geronimo-dev-help@incubator.apache.org wrote:

>Hi! This is the ezmlm program. I'm managing the
>geronimo-dev@incubator.apache.org mailing list.
>
>  
>
>>Return-Path: <db...@wibdio.net>
>>Mailing-List: contact geronimo-dev-help@incubator.apache.org; run by ezmlm
>>Delivered-To: mailing list geronimo-dev@incubator.apache.org
>>Received: (qmail 14832 invoked from network); 23 Apr 2004 21:07:39 -0000
>>Received: from unknown (HELO conn.mc.mpls.visi.com) (208.42.156.2)
>>  by daedalus.apache.org with SMTP; 23 Apr 2004 21:07:39 -0000
>>Received: from sweetums.wibdio.net (c-66-41-158-180.mn.client2.attbi.com [66.41.158.180])
>>	by conn.mc.mpls.visi.com (Postfix) with ESMTP id 04FDA820E
>>	for <ge...@incubator.apache.org>; Fri, 23 Apr 2004 16:07:45 -0500 (CDT)
>>Received: by sweetums.wibdio.net (Postfix, from userid 500)
>>	id 05FC41577BE; Fri, 23 Apr 2004 17:07:44 -0400 (EDT)
>>Date: Fri, 23 Apr 2004 16:07:43 -0500
>>From: David Blevins <da...@visi.com>
>>To: geronimo-dev@incubator.apache.org
>>Subject: Re: Eclipse issue
>>Message-ID: <20...@sweetums.ce1.client2.attbi.com>
>>References: <00...@MarianIhmeKone>
>>Mime-Version: 1.0
>>Content-Type: text/plain; charset=us-ascii
>>Content-Disposition: inline
>>In-Reply-To: <00...@MarianIhmeKone>
>>User-Agent: Mutt/1.4i
>>X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
>>
>>On Fri, Apr 23, 2004 at 11:34:24PM +0300, Jukka Uusisalo wrote:
>>    
>>
>>>Hi,
>>>
>>>Does somebody have suggestions or good practices how create eclipse projects
>>>against geronimo directory structure from cvs?
>>>
>>>I made one eclipse project like geronimo-module = eclipse-module, but it
>>>feels
>>>little bit hard to find needed parts to get compiled etc. Also one big
>>>project with several
>>>source root does not make me happy.
>>>
>>>Any ideas, propably some has done this before?
>>>      
>>>
>>I do this bash loop in the incubator-geronimo dir after a cvs checkout.
>>
>>    for module in "$(find ./*/ -name project.xml | sed 's/project.xml//')"; do
>>        echo $module
>>        pushd $PWD &> /dev/null; 
>>        cd $module
>>        maven eclipse > /dev/null
>>        popd &> /dev/null
>>    done;
>>
>>Then you just have to refresh or import the eclipse projects.
>>
>>-David
>>
>>    
>>


Re: Eclipse issue -- maven eclipse - David's bash loop

Posted by David Blevins <da...@visi.com>.
On Wed, May 12, 2004 at 04:35:55PM +0200, Ralf Barkow wrote:
> 
> As David's bash loop didn't worked for me with Cygwin,
> I post a modified version. Now I'm looking for a current
> .launch file to be able to debug in ecplise. Anyone?

I looked for '.launch' files on my system but didn't find any.  I'm
using 3.0 M5.

> 
> --- schnipp ---
> 
> #!/usr/bin/bash
> for modules in "$(find ./*/ -name project.xml | sed 's/project.xml//')"; do
>    echo $modules;
>    for module in $modules
>    do
>      pushd $module &> /dev/null
>      maven eclipse > /dev/null
>      popd &> /dev/null
>    done;
> done;
> 
> --- schnapp ---

Aha, I see the issue; the quoting around the $() subprocess is causing the loop to see it as one big entry.  That's why you added the second loop--to do the job the first one should have done.

modules="$(find ./*/ -name project.xml | sed 's/project.xml//')";

for module in $modules; do
   pushd $module &> /dev/null
   maven eclipse > /dev/null
   popd &> /dev/null
done;

That should work the same as the other, but be less missleading as to how many loops there actually are.

-David

Re: Eclipse issue -- maven eclipse

Posted by David Blevins <da...@visi.com>.
On Wed, May 19, 2004 at 01:32:18PM +0200, Ralf Barkow wrote:
> 
> Thanks Patrick for the attached .launch file.!
> Thanks David for 'refactoring' and posting the improved shell script.!
> 

Wow.  You said refactoring and shell script in the same sentence.  In
public, no less.  You're all kinds of brave.

Ralf, you're my hero :)

Thanks much for the launch file.  At first glance, it looks easy
enough to generate.  If I ever hack something together, I'll make sure
and post it to the list.

-David

Re: Eclipse issue -- maven eclipse

Posted by Patrick Mueller <pm...@yahoo.com>.
Ralf Barkow wrote:

> Thanks Patrick for the attached .launch file.!
> Thanks David for 'refactoring' and posting the improved shell script.!
> 
> Yes Patrick, I want it to run against 'live' code.

I haven't figured this out yet.  At least, how you can run against code 
compiled by Eclipse assuming you have set everything up so it's directly 
compilable by Eclipse.  I get various sorts of exceptions when running. 
  I believe that there must be some non-.class file resources that are 
built by maven, stuck in the associated jars, that can't be found. 
Either that, or there is just a general classpath problem, as the way I 
have tried the launches is to put everything on the classpath when 
running (ie, it may be that a certain classpath hierarchy/graph is 
required to run correctly).

I'm sort of torn between figuring this out vs. trying to get Eclipse to 
just run maven as part of it's build process.  Essentially a double 
compile (I still want Eclipse to build it's versions of the .class 
files, to be able to get instant feed back on errors, get exact code 
completion, and get all the introspective stuff working).

I'll report back when I find something useful.  As I'm not actually 
developing Geronimo code ... for now ... it's not a critical issue for 
me at the moment ... sorry.

-- 
Patrick Mueller
pmuellr@yahoo.com

Re: Eclipse issue -- maven eclipse

Posted by Eric Le Goff <er...@gicm.fr>.
Ralf Barkow wrote:

>
> Thanks Patrick for the attached .launch file.!
> Thanks David for 'refactoring' and posting the improved shell script.!

There is a page on wiki 
(http://wiki.apache.org/geronimo/FrequentlyAskedQuestions) where you 
could document your "howto use Eclipse/maven"
(The Eclipse issue is at 4.4.2 on this page)
Currently there is only David's bash script, but I guess Patrick's 
method could be there too ;)


Eric

-- 
=Q=u=o=t=e===o=f===t=h=e===d=a=y=====================================
"The Avis WIZARD decides if you get to drive a car. Your head won't touch the
pillow of a Sheraton unless their computer says it's okay."
-- Arthur Miller



Re: Eclipse issue -- maven eclipse

Posted by Ralf Barkow <Ra...@web.de>.
Thanks Patrick for the attached .launch file.!
Thanks David for 'refactoring' and posting the improved shell script.!

Yes Patrick, I want it to run against 'live' code.

Patrick Mueller wrote:
[.launch file]

> However ... I suspect what you want is to run against 'live' code, not 
> the maven built jars.  This is going to be more work.  The easiest 
> thing to do is to use Eclipse for editing/launching/debugging, but not 
> for build.  Do your builds outside of eclipse.  


Currently building outside of eclipse in ~/incubator-geronimo and using 
David's shell script to do a "maven eclipse" with the 
maven-eclipse-plugin in each of geronimo's modules.  In Eclipse you do 
an "Import | Existing Project into Workspace" for every module you want 
to look at. 

Consider using Mevenide (no typo) http://mevenide.codehaus.org/ to 
integrate Maven into Eclipse.  This gives you --among other things-- 
Maven launcher integration into Eclipse External Tools. 

To be able to use Patrick's .launch file with David's approach,  you 
perform the following steps in Eclipse :-
(1) Create incubator-geronimo as a top-level project in Eclipse with 
"New | Project" and the Java Project wizard. 
(2) Add a "New | Folder" named: target to that project.
(3) "Import ..." from File System
        From directory ~/incubator-geronimo/target into the freshly 
created target folder. 
        Note: "Create selected folders only". 
(4) Copy Geronimo-jars.launch to your eclipse workspace: 
/incubator-geronimo/Geronimo-jars.launch
(5) "Add Projects..." geronimo-system et al to the "Source Lookup Path" 
of that Geronimo-jars configuration. 
(6) Run the pre-built DebugConsole configuration and/or debug it inside 
Eclipse -- and have fun ... 

Find attached a slightly modified Geronimo-jars.launch file for the 
1.0-SNAPSHOT. Note: Not all modules were added to the Source Lookup 
Path, only geronimo-system for the moment.

Cheers,
-- 
/rgb 

Re: Eclipse issue -- maven eclipse - David's bash loop

Posted by Patrick Mueller <pm...@yahoo.com>.
Ralf Barkow wrote:
> As David's bash loop didn't worked for me with Cygwin,
> I post a modified version. Now I'm looking for a current
> .launch file to be able to debug in ecplise. Anyone?

I've attached a .launch file, but this is a transliteration of the 
command-line invocation; namely, pop open server.jar to see what jars it 
adds to the classpath, and put them in the launch's classpath (and make 
sure server.jar is also on the classpath).

Oh, and this is with incubator-geronimo as a top-level project in Eclipse.

I can both run and debug fine with this.

However ... I suspect what you want is to run against 'live' code, not 
the maven built jars.  This is going to be more work.  The easiest thing 
to do is to use Eclipse for editing/launching/debugging, but not for 
build.  Do your builds outside of eclipse.  I suspect, in the right 
conditions, even hot-swap will work in this mode.  (hot-swap is where 
the IDE feeds changed .class files to the debug target VM, while it's 
running).

-- 
Patrick Mueller
pmuellr@yahoo.com