You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Rick <ri...@gmail.com> on 2008/09/28 22:55:40 UTC
no main or test directories created when using webapp archetype?
I'm confused... when I run the maven webapp archetype I only end up
with "resources" and "webapp" directories created.. no java/src/main
or java/src/test ? Shouldn't it make those directories for me?
I tested with the archetype as shown here on the maven2 site:
http://maven.apache.org/guides/mini/guide-webapp.html
--
Rick
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: no main or test directories created when using webapp archetype?
Posted by Thor <me...@gmail.com>.
I agree with Rick, if you have servlets, filters, even actions (struts,
webwork, etc.) i think there is no need to separate the code from your web
module (if your views depends on it). Nevertheless, separating the code from
the views it's a very elegant approach...
If the Eclipse workspace wasn't flat, I think it would be easier and pretty
much straightforward to work with multimodule projects. It can be really
messy if you have, let's say, three or four projects with 4 or five
different modules. But that's just my opinion.
I read somewhere that the Eclipse guys were considering to change it's
workpace structure in future releases...
But like Graham said Eclipse does support multimodule projects (of course
with the help of the maven eclipse plugin!!!)
Regards people...
On Sun, Sep 28, 2008 at 4:27 PM, Graham Leggett <mi...@sharp.fm> wrote:
> Rick wrote:
>
> (Now if Eclipse supported multi-modules better I wouldn't' mind as
>> much. I wish there was a way I could have a project in eclipse
>> represented by the parent pom and then have all the sub modules
>> beneath it. Back when I used IDEA, I think this was possible. Does
>> NetBeans maybe support this?)
>>
>
> Eclipse does support multi-modules, use it all the time.
>
> Make sure that your eclipse config is generated by the maven-eclipse-plugin
> to do this the easy way. Each module of a multi-module project will be added
> as a project dependency (instead of a jar dependency) in eclipse.
>
> Regards,
> Graham
> --
>
Re: no main or test directories created when using webapp archetype?
Posted by Graham Leggett <mi...@sharp.fm>.
Rick wrote:
> (Now if Eclipse supported multi-modules better I wouldn't' mind as
> much. I wish there was a way I could have a project in eclipse
> represented by the parent pom and then have all the sub modules
> beneath it. Back when I used IDEA, I think this was possible. Does
> NetBeans maybe support this?)
Eclipse does support multi-modules, use it all the time.
Make sure that your eclipse config is generated by the
maven-eclipse-plugin to do this the easy way. Each module of a
multi-module project will be added as a project dependency (instead of a
jar dependency) in eclipse.
Regards,
Graham
--
Re: no main or test directories created when using webapp archetype?
Posted by Wendy Smoak <ws...@gmail.com>.
On Sun, Sep 28, 2008 at 3:05 PM, Rick <ri...@gmail.com> wrote:
> Ok interesting. Thanks Wendy. I didn't think of creating a separate
> module for the web-related java classes. Is this a common practice? I
> agree in separation of concerns, but that might be a bit much. In
> other words a servlet isn't going to be any good stand-alone (outside
> of the concept of web project) so it makes sense for me to have all
> that in a 'web module.'
It's up to you, and I do see many webapp modules with code in them.
One advantage of keeping the code separate is that it encourages
testing outside of the container.
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: no main or test directories created when using webapp archetype?
Posted by Rick <ri...@gmail.com>.
On Sun, Sep 28, 2008 at 5:11 PM, Wendy Smoak <ws...@gmail.com> wrote:
>
> The archetype is encouraging the best practice of putting the Java
> code in a separate module.
>
> If you need the directories, you can create them. If this is
> something you need often, you can create your own archetype.
Ok interesting. Thanks Wendy. I didn't think of creating a separate
module for the web-related java classes. Is this a common practice? I
agree in separation of concerns, but that might be a bit much. In
other words a servlet isn't going to be any good stand-alone (outside
of the concept of web project) so it makes sense for me to have all
that in a 'web module.'
(Now if Eclipse supported multi-modules better I wouldn't' mind as
much. I wish there was a way I could have a project in eclipse
represented by the parent pom and then have all the sub modules
beneath it. Back when I used IDEA, I think this was possible. Does
NetBeans maybe support this?)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: no main or test directories created when using webapp archetype?
Posted by Wendy Smoak <ws...@gmail.com>.
On Sun, Sep 28, 2008 at 1:55 PM, Rick <ri...@gmail.com> wrote:
> I'm confused... when I run the maven webapp archetype I only end up
> with "resources" and "webapp" directories created.. no java/src/main
> or java/src/test ? Shouldn't it make those directories for me?
The archetype is encouraging the best practice of putting the Java
code in a separate module.
If you need the directories, you can create them. If this is
something you need often, you can create your own archetype.
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: no main or test directories created when using webapp archetype?
Posted by Rick <ri...@gmail.com>.
I should clarify.. 'main' is created.. just no java directory (or
test) is created even when I provide the package declaration with
-DpackageName=com.foobar
On Sun, Sep 28, 2008 at 4:55 PM, Rick <ri...@gmail.com> wrote:
> I'm confused... when I run the maven webapp archetype I only end up
> with "resources" and "webapp" directories created.. no java/src/main
> or java/src/test ? Shouldn't it make those directories for me?
>
> I tested with the archetype as shown here on the maven2 site:
>
> http://maven.apache.org/guides/mini/guide-webapp.html
>
> --
> Rick
>
--
Rick
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org