Multiple Source Directories Support

61 views
Skip to first unread message

Matt Raible

unread,
Sep 15, 2009, 10:34:42 PM9/15/09
to gwt-...@googlegroups.com
Are there any plans to add multiple source directories support like the jetty-maven-plugin has?

http://docs.codehaus.org/display/JETTY/Multiple+WebApp+Source+Directory

I believe this could be very useful for modularizing GWT applications. If it's not currently implemented, I'd be interested in knowing if there might be any issues in adding support.

Thanks,

Matt

Robert "kebernet" Cooper

unread,
Sep 15, 2009, 10:39:02 PM9/15/09
to gwt-...@googlegroups.com

If you just want sources for gwt compiles, you can add resource directories then dilter them for ja files. This was my solution to keep gwt .class files out of war WEB-INF/classes structs.

Robert "kebernet" Cooper

unread,
Sep 15, 2009, 10:40:34 PM9/15/09
to gwt-...@googlegroups.com

Forgive the soft keyboard isms in last.

On Sep 15, 2009 10:39 PM, "Robert "kebernet" Cooper" <kebe...@gmail.com> wrote:

If you just want sources for gwt compiles, you can add resource directories then dilter them for ja files. This was my solution to keep gwt .class files out of war WEB-INF/classes structs.

> > On Sep 15, 2009 10:35 PM, "Matt Raible" <ma...@raibledesigns.com> wrote: > > Are there any plans...

Matt Raible

unread,
Sep 15, 2009, 10:43:49 PM9/15/09
to gwt-...@googlegroups.com
I believe I sent this to the wrong list - will send to the codehaus list and clarify there.

Thanks,

Matt

Robert "kebernet" Cooper

unread,
Sep 15, 2009, 10:52:10 PM9/15/09
to gwt-...@googlegroups.com

The same rules should apply either way. Putting your client-only classes in a dir, then putting rhat dir in a resources path will let you separate out code. The res paths will be there for gwt compile only, since it wants .java files on the classpath, but excluded from the rest of the source tree. The only drawback is junit tests on client code not in gwttestcase.

On Sep 15, 2009 10:44 PM, "Matt Raible" <ma...@raibledesigns.com> wrote:

I believe I sent this to the wrong list - will send to the codehaus list and clarify there.

Thanks,

Matt

On Tue, Sep 15, 2009 at 8:39 PM, Robert "kebernet" Cooper <kebe...@gmail.com> wrote: > > If you j...

jie...@gmail.com

unread,
Sep 15, 2009, 10:59:01 PM9/15/09
to gwt-...@googlegroups.com
Hi,

Granted, I've over-dosed on the Maven kool-aid but.... This seems
completely wrong, sorry Coop. Why not just configure
maven-war-plugin/maven-ear-plugin to exclude .java files? This way you
keep your source code where it belongs, inside src/main/java.

If your interest is in modularization of widgets, then that's exactly
the job for Maven modules. Just add an <inherits in the master
Application.gwt.xml for each widget you want to include from a
different module in the same project.

-jesse

--
There are 10 types of people in this world, those
that can read binary and those that can not.

Robert "kebernet" Cooper

unread,
Sep 15, 2009, 11:03:03 PM9/15/09
to gwt-...@googlegroups.com

I think you missed my point. I didn't want the java files excluded, I wanted the class files for client code excluded. Thecmaven war plugin won't let you filter class files, but you don't meed them for gwt compile, so making the gwt source dirs resources then filtering out .java files means no java or class files in the war for gwt code.

On Sep 15, 2009 10:59 PM, <jie...@gmail.com> wrote:


Hi,

On Tue, Sep 15, 2009 at 10:52 PM, Robert "kebernet" Cooper <kebe...@gmail.com> wrote: > The same r...

Granted, I've over-dosed on the Maven kool-aid but.... This seems
completely wrong, sorry Coop. Why not just configure
maven-war-plugin/maven-ear-plugin to exclude .java files? This way you
keep your source code where it belongs, inside src/main/java.

If your interest is in modularization of widgets, then that's exactly
the job for Maven modules. Just add an <inherits in the master
Application.gwt.xml for each widget you want to include from a
different module in the same project.

-jesse

--
There are 10 types of people in this world, those
that can read binary and those that can not.

--~--~---------~--~----~------------~-------~--~----~ You received this message because you are sub...

jie...@gmail.com

unread,
Sep 15, 2009, 11:22:11 PM9/15/09
to gwt-...@googlegroups.com
Hi Robert,

On Tue, Sep 15, 2009 at 11:03 PM, Robert "kebernet" Cooper
<kebe...@gmail.com> wrote:
> I think you missed my point. I didn't want the java files excluded, I wanted
> the class files for client code excluded. Thecmaven war plugin won't let you
> filter class files, but you don't meed them for gwt compile, so making the
> gwt source dirs resources then filtering out .java files means no java or
> class files in the war for gwt code.
>

Yes, I think I definitely have. I really can not visualize your
strategy at all. I personally prefer to attach a m-source-p:jar goal
and then use a <classifier>source</classifier> dependency. I find this
to be the least anti-Maven solution which still allows GWT to do its
thing.

Robert "kebernet" Cooper

unread,
Sep 15, 2009, 11:23:25 PM9/15/09
to gwt-...@googlegroups.com

Fwiw, the main reason to exclude the gwt .class files is app engine has a hard limit on files in a war, and 100+ gwt class files you don't need will push you over. Yes, you can move them to a jar dep, but that costs you "hit reload" development in hosted mode.

On Sep 15, 2009 11:03 PM, "Robert "kebernet" Cooper" <kebe...@gmail.com> wrote:

I think you missed my point. I didn't want the java files excluded, I wanted the class files for client code excluded. Thecmaven war plugin won't let you filter class files, but you don't meed them for gwt compile, so making the gwt source dirs resources then filtering out .java files means no java or class files in the war for gwt code.

> > On Sep 15, 2009 10:59 PM, <jie...@gmail.com> wrote: > > > Hi,

On Tue, Sep 15, 2009 at 10:52 PM, Robert "kebernet" Cooper <kebe...@gmail.com> wrote: > The same r...

> > Granted, I've over-dosed on the Maven kool-aid but.... This seems > completely wrong, sorry Coo...

David Durham

unread,
Sep 21, 2009, 11:59:49 AM9/21/09
to gwt-...@googlegroups.com


I noticed that with m2eclipse, and having all the related projects
open in my workspace, the end result is what you want. Changes to
java source in dependencies, i.e., <inherits..>, are immediately
reflected by refresh of the hosted mode browser. I think this is not
exactly what you're asking for, but thought it worth mentioning.

-Dave

Matt Raible

unread,
Sep 21, 2009, 12:02:55 PM9/21/09
to gwt-maven


On Sep 21, 9:59 am, David Durham <david.durham...@gmail.com> wrote:
But then I'd have to use Eclipse. ;-)

I believe you're correct in that if I use the GWT features of my IDE
(IDEA in my case) and run in debug mode, I can get the desired result.
Since I often run "mvn gwt:run" from the command line, the builder-
helper plugin adds the functionality I'm looking for.

Thanks,

Matt

David Durham

unread,
Sep 21, 2009, 12:09:12 PM9/21/09
to gwt-...@googlegroups.com
> But then I'd have to use Eclipse. ;-)
>
> I believe you're correct in that if I use the GWT features of my IDE
> (IDEA in my case) and run in debug mode, I can get the desired result.
> Since I often run "mvn gwt:run" from the command line, the builder-
> helper plugin adds the functionality I'm looking for.

My experience is that you get most of the GWT compile that you want,
i.e., java sources are pulled in. However, css, images, etc. were not
pulled in automatically .. so it wasn't quite what I wanted.

-Dave

Reply all
Reply to author
Forward
0 new messages