You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Peter Wendorff <we...@uni-paderborn.de> on 2013/01/28 20:48:16 UTC
Modular Tapestry application in Eclipse
Hi.
I tried to setup a modular tapestry application with Maven and Eclipse.
Creating the core application with maven is easy and works.
Creating a java project with a Manifest file that exports some packages
I easy, but how do I get the core application to find/load the module
using run Jetty?
How/Where do I have to set the dependencies?
Is there a sample project setup for that use case? (modular tapestry
application in eclipse using jetty as (debug) container)
regards
Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Modular Tapestry application in Eclipse
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
Actually, what you're asking is about module autoloading and it's
described here: http://tapestry.apache.org/autoloading-modules.html.
Summary: put the JARs in the classpath. If they have the right MANIFEST.MF
entries, Tapestry-IoC will find the modules and load them automatically
them.
On Mon, 28 Jan 2013 17:57:22 -0200, Thiago H de Paula Figueiredo
<th...@gmail.com> wrote:
> On Mon, 28 Jan 2013 17:48:16 -0200, Peter Wendorff
> <we...@uni-paderborn.de> wrote:
>
>> Hi.
>
> Hi!
>
>> I tried to setup a modular tapestry application with Maven and Eclipse.
>> Creating the core application with maven is easy and works.
>> Creating a java project with a Manifest file that exports some packages
>> I easy, but how do I get the core application to find/load the module
>> using run Jetty?
>
> The same way you would in production: by having a JAR with the correct
> info in it or by using @SubModule.
>
>> How/Where do I have to set the dependencies?
>
> The same way you'd do without Tapestry: manually, in the project
> settings, or using m2eclipse or something like that.
>
>> Is there a sample project setup for that use case? (modular tapestry
>> application in eclipse using jetty as (debug) container)
>
> Use @SubModule({Module1.class, Module2.class}) in your AppModule class.
> It'll work whether or not your modules are packed in JARs or not.
>
--
Thiago H. de Paula Figueiredo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Modular Tapestry application in Eclipse
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Mon, 28 Jan 2013 17:48:16 -0200, Peter Wendorff
<we...@uni-paderborn.de> wrote:
> Hi.
Hi!
> I tried to setup a modular tapestry application with Maven and Eclipse.
> Creating the core application with maven is easy and works.
> Creating a java project with a Manifest file that exports some packages
> I easy, but how do I get the core application to find/load the module
> using run Jetty?
The same way you would in production: by having a JAR with the correct
info in it or by using @SubModule.
> How/Where do I have to set the dependencies?
The same way you'd do without Tapestry: manually, in the project settings,
or using m2eclipse or something like that.
> Is there a sample project setup for that use case? (modular tapestry
> application in eclipse using jetty as (debug) container)
Use @SubModule({Module1.class, Module2.class}) in your AppModule class.
It'll work whether or not your modules are packed in JARs or not.
--
Thiago H. de Paula Figueiredo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Modular Tapestry application in Eclipse
Posted by Lance Java <la...@googlemail.com>.
I asked the same question here:
http://tapestry.1045711.n5.nabble.com/Eclipse-Can-run-against-maven-jar-can-t-run-against-local-project-td5714087.html
When running against a project in eclipse, you are running against .class
files on the classpath, not a jar file. So tapestry can't see the manifest
file(s) and can't auto-load the extra AppModules.
I solve this by setting a system property on my run-jetty-run launcher
eg: -Dtapestry.modules=foo.bar.ModuleA,foo.bar.ModuleB
This can also be solved by using the @SubModule annotation in your webapp's
AppModule. Don't worry, in production it won't include them twice. I don't
really like this approach as it defeats the purpose of the manifest.
--
View this message in context: http://tapestry.1045711.n5.nabble.com/Modular-Tapestry-application-in-Eclipse-tp5719628p5719634.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Modular Tapestry application in Eclipse
Posted by Nicolas Barrera <nb...@gmail.com>.
As an alternative to Jonathan approach (which I didn't know until know...
and it looks good btw)...
I'm using this configuration to the jetty plugin in the pom.xml (also to
use workspace resolution with m2eclipse, as he said it's useful to not
having to mvn install modules all the time)
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<systemProperties>
<systemProperty>
<name>
tapestry.modules
</name>
<value>
com.xxx.MyModule1,
com.xxx.MyModule2
</value>
</systemProperty>
<systemProperty>
<name>tapestry.production-mode</name>
<value>false</value>
</systemProperty>
</systemProperties>
anyway using the @SubModule method is the same as this... but this way I
don't need to use the annotation (which for me is cool because it's just
like in the production environment).
cheers.
Nicolás.-
On Mon, Jan 28, 2013 at 5:43 PM, Jonathan Barker <
jonathan.theitguy@gmail.com> wrote:
> If you want to enable Workspace Resolution with m2eclipse, you also
> may want to look into the <extraClasspath> configuration item in the
> maven jetty plugin.
> (<plugin><configuration><webAppConfig><extraClasspath>...)
>
> M2eclipse lets you see the module's classes while you work, and the
> extraClasspath entry lets Jetty see them without having to repeatedly
> mvn install your module. So, you would have something like
>
> <extraClasspath>../module1/target/classes,../module2/target/classes</extraClasspath>
>
> I find this can get a bit finnicky at times, but it can save time when
> a module is undergoing lots of changes.
>
> On Mon, Jan 28, 2013 at 2:48 PM, Peter Wendorff
> <we...@uni-paderborn.de> wrote:
> > Hi.
> > I tried to setup a modular tapestry application with Maven and Eclipse.
> > Creating the core application with maven is easy and works.
> > Creating a java project with a Manifest file that exports some packages I
> > easy, but how do I get the core application to find/load the module using
> > run Jetty?
> > How/Where do I have to set the dependencies?
> > Is there a sample project setup for that use case? (modular tapestry
> > application in eclipse using jetty as (debug) container)
> >
> > regards
> > Peter
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
>
>
>
> --
> Jonathan Barker
> ITStrategic
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: Modular Tapestry application in Eclipse
Posted by Jonathan Barker <jo...@gmail.com>.
If you want to enable Workspace Resolution with m2eclipse, you also
may want to look into the <extraClasspath> configuration item in the
maven jetty plugin.
(<plugin><configuration><webAppConfig><extraClasspath>...)
M2eclipse lets you see the module's classes while you work, and the
extraClasspath entry lets Jetty see them without having to repeatedly
mvn install your module. So, you would have something like
<extraClasspath>../module1/target/classes,../module2/target/classes</extraClasspath>
I find this can get a bit finnicky at times, but it can save time when
a module is undergoing lots of changes.
On Mon, Jan 28, 2013 at 2:48 PM, Peter Wendorff
<we...@uni-paderborn.de> wrote:
> Hi.
> I tried to setup a modular tapestry application with Maven and Eclipse.
> Creating the core application with maven is easy and works.
> Creating a java project with a Manifest file that exports some packages I
> easy, but how do I get the core application to find/load the module using
> run Jetty?
> How/Where do I have to set the dependencies?
> Is there a sample project setup for that use case? (modular tapestry
> application in eclipse using jetty as (debug) container)
>
> regards
> Peter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
--
Jonathan Barker
ITStrategic
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Modular Tapestry application in Eclipse
Posted by Lance Java <la...@googlemail.com>.
Have you seen this page?
http://tapestry.apache.org/component-libraries.html
It tells you all you need.
--
View this message in context: http://tapestry.1045711.n5.nabble.com/Modular-Tapestry-application-in-Eclipse-tp5719628p5719636.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Modular Tapestry application in Eclipse
Posted by Peter Wendorff <we...@uni-paderborn.de>.
Hi again.
Thanks for your answers alltogether.
Finally I got it to work now. The @Submodule annotation I think was at
least part of the solution, but it didn't work directly with that only.
I'm not completely sure what else I changed, but now it's working and
I'm able to create additional modules.
One issue remaining was that I hoped to be able to contribute
pages/components/mixins in different namespaces in the modules.
Where
org.example.pages is the "main" pages package of the core application, I
would like to somehow configure
org.example.users.pages for the UI module handling user accounts and
settings,
org.examples.geocoding.pages for the geocoding module and so on.
If it's possible to configure that somehow that would be really great,
but if not, it's not that important.
Thanks so far
regards
Peter
Am 28.01.2013 20:48, schrieb Peter Wendorff:
> Hi.
> I tried to setup a modular tapestry application with Maven and Eclipse.
> Creating the core application with maven is easy and works.
> Creating a java project with a Manifest file that exports some
> packages I easy, but how do I get the core application to find/load
> the module using run Jetty?
> How/Where do I have to set the dependencies?
> Is there a sample project setup for that use case? (modular tapestry
> application in eclipse using jetty as (debug) container)
>
> regards
> Peter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org