You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Muhammad Gelbana <m....@gmail.com> on 2013/09/30 19:28:34 UTC

Development environment for a modular Tapestry app

I'm using Eclipse and Jetty. Back when I first started using Tapestry, I
had ALL my code in on .war file. This made it easy to make use of the class
reloading feature, which is to edit a java class\tml, and the effect takes
place almost instantly !

But now my application is very modular, I have like 4 different modules
deployed interchangeably for different clients and I'm serving them all at
the same time.

So to test a Tapestry web app, I configure different run configurations,
each configuration having it's related modules (.jar) in it's class-path.

Here comes the problem. When I edit my code, and build my module into a
.jar file, the build is broken because the .jar file is already used by the
loaded web app in jetty. So I can't make use of the class-reloading feature.

And even if I do no include jars and just use Eclipse's projects. I have to
edit almost all my modules by annotating them, to explicitly state the
modules they depend on.

This is VERY annoying and wastes a lot of time. I sometimes make mistakes
so it could really waste a lot of time.

Has anyone faced a similar situation and would care to share a better
environment setup ?


*---------------------*
*Muhammad Gelbana*
http://eg.linkedin.com/in/mgelbana/

Re: Development environment for a modular Tapestry app

Posted by Lance Java <la...@googlemail.com>.
BTW tapestry-stitch has two modules (component library + webapp) and I
develop in eclipse using m2e + RunJettyRun.

As you can see, StitchModule is added to the manifest here:
https://github.com/uklance/tapestry-stitch/blob/master/pom.xml#L67

But also declared as a SubModule here for easy testing:
https://github.com/uklance/tapestry-stitch-demo/blob/master/src/main/java/org/lazan/t5/stitch/demo/services/AppModule.java#L12

Re: Development environment for a modular Tapestry app

Posted by Lance Java <la...@googlemail.com>.
If you are using m2e maven eclipse plugin then it should do the "right"
thing

1. If it can resolve the dependency from your eclipse workspace, it will
use the local class files

2. If not (lets say you close / delete the project) then it will use the
jar files from your maven repository

The RunJettyRun plugin simply uses your m2e classpath.

The only problem comes with loading modules from the jar's manifest. When
using local class files the manifest is not read. So you need an explicit
@SubModule annotation but I don't see this as a huge problem. You can add
the @SubModule this to your DevelopmentModule if you like,  It's also fine
to put it in your production AppModule since tapestry IOC checks for
duplicates and never loads a module twice.

Re: Development environment for a modular Tapestry app

Posted by Muhammad Gelbana <m....@gmail.com>.
@Thiago
I'm using RunJettyRun. I think the other method you are referring to is
maven's jetty:run ? Well I don't use maven at all.

Yes I mean @Submodule. Editing my modules every time I need to load a
specific set of modules is time consuming and error prone.

I only need to be able to run my multi-module project, edit and make use of
the class reloading feature without much effort. Having multiple configured
setups (different sets of module in each run-configuration) is my aim here.

Any method to test multi-module web projects will be just great. Would
anyone care to share his setup ? :)

*---------------------*
*Muhammad Gelbana*
http://eg.linkedin.com/in/mgelbana/


On Mon, Sep 30, 2013 at 8:23 PM, Jan Fryblik <ja...@ebrothers.cz>wrote:

> On Mon, 30 Sep 2013 19:40:42 +0200, Thiago H de Paula Figueiredo <
> thiagohp@gmail.com> wrote:
>
>  On Mon, 30 Sep 2013 14:28:34 -0300, Muhammad Gelbana <m....@gmail.com>
>> wrote:
>>
>>  Here comes the problem. When I edit my code, and build my module into a
>>> .jar file, the build is broken because the .jar file is already used by
>>> the loaded web app in jetty. So I can't make use of the class-reloading
>>> feature.
>>>
>>
>> It seems you're adding the same classes twice in the classpath. This
>> should be avoided anyway.
>>
>> What are you using to launch Jetty? jetty:run sucks for multi-project
>> development. RunJettyRun or embedded Jetty instance work waaaaaaaaaaaay
>> better.
>>
>
> Probably i have same issue. Actually I thought its not issue, its
> consequence. :)
>
> I'm using 'gradle jettyRun' and when jetty is running and i deploy
> tapestry module JAR with changed tapestry components. It ends up with
> 'Unable to resolve .... to a component class name.' exception. So as you
> said, can i deploy tapestry module without such error? Thanks for answer.
>
>
>
>
>>  And even if I do no include jars and just use Eclipse's projects. I have
>>> to edit almost all my modules by annotating them, to explicitly state the
>>> modules they depend on.
>>>
>>
>> You mean @Submodule?
>>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@tapestry.apache.org>
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Development environment for a modular Tapestry app

Posted by Jan Fryblik <ja...@ebrothers.cz>.
On Mon, 30 Sep 2013 19:40:42 +0200, Thiago H de Paula Figueiredo  
<th...@gmail.com> wrote:

> On Mon, 30 Sep 2013 14:28:34 -0300, Muhammad Gelbana  
> <m....@gmail.com> wrote:
>
>> Here comes the problem. When I edit my code, and build my module into a
>> .jar file, the build is broken because the .jar file is already used by  
>> the loaded web app in jetty. So I can't make use of the class-reloading  
>> feature.
>
> It seems you're adding the same classes twice in the classpath. This  
> should be avoided anyway.
>
> What are you using to launch Jetty? jetty:run sucks for multi-project  
> development. RunJettyRun or embedded Jetty instance work waaaaaaaaaaaay  
> better.

Probably i have same issue. Actually I thought its not issue, its  
consequence. :)

I'm using 'gradle jettyRun' and when jetty is running and i deploy  
tapestry module JAR with changed tapestry components. It ends up with  
'Unable to resolve .... to a component class name.' exception. So as you  
said, can i deploy tapestry module without such error? Thanks for answer.


>
>> And even if I do no include jars and just use Eclipse's projects. I  
>> have to edit almost all my modules by annotating them, to explicitly  
>> state the
>> modules they depend on.
>
> You mean @Submodule?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Development environment for a modular Tapestry app

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Mon, 30 Sep 2013 14:28:34 -0300, Muhammad Gelbana <m....@gmail.com>  
wrote:

> Here comes the problem. When I edit my code, and build my module into a
> .jar file, the build is broken because the .jar file is already used by  
> the loaded web app in jetty. So I can't make use of the class-reloading  
> feature.

It seems you're adding the same classes twice in the classpath. This  
should be avoided anyway.

What are you using to launch Jetty? jetty:run sucks for multi-project  
development. RunJettyRun or embedded Jetty instance work waaaaaaaaaaaay  
better.

> And even if I do no include jars and just use Eclipse's projects. I have  
> to edit almost all my modules by annotating them, to explicitly state the
> modules they depend on.

You mean @Submodule?

-- 
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org