Suggested directory structure for Eclipse Web Projects [message #191469] |
Sat, 14 April 2007 04:31  |
Eclipse User |
|
|
|
Originally posted by: jgliniecki.gmail.com
I started on a project where the web application (mostly JSPs and
Servlets) is in CVS with a directory structure similar to what would be
in a WAR file. However, when creating a Dynamic Web Project in Eclipse,
it creates a WebContent folder that contains the WEB-INF folder.
Is it common practice to have the directory structure in CVS, SVN, etc
match that of the IDE and in this case have a WebContent folder?
Alternatively, could I remove the WebContent folder from the project and
have the structure be similar to what is in a WAR file? I did some
preliminary testing, and Run on Server only seems to work if the JSP is in
the WebContent folder.
Thanks,
Joe
|
|
|
Re: Suggested directory structure for Eclipse Web Projects [message #191532 is a reply to message #191469] |
Mon, 16 April 2007 15:52   |
Eclipse User |
|
|
|
Originally posted by: kosta.bea.com
Eclipse creates a separate WebContent directory to segregate project
metadata files and build artifacts (which exist in various places in the
project directory. By using a separate directory for web content, you
can easily export a web archive (.war file) without doing complicated
exclusions.
- Konstantin
|
|
|
Re: Suggested directory structure for Eclipse Web Projects [message #191602 is a reply to message #191532] |
Tue, 17 April 2007 20:56   |
Eclipse User |
|
|
|
Originally posted by: jgliniecki.gmail.com
Thanks Konstantin,
Two follow-up questions... Is it standard practice to have the directory
structure in the source repository, say, CVS, be the same as what Eclipse
uses (the repository would have a WebContent folder)?
Secondly, I noticed that servlet class files are put in a "build"
directory instead of the more standard WEB-INF/classes directory. So when
creating a WAR file, I guess a person needs to copy the class files from
the build directory or compile the servlets themselves. You can't just put
everything from the WebContent directory into the WAR, otherwise it would
be without servlets?
Thanks,
Joe
|
|
|
Re: Suggested directory structure for Eclipse Web Projects [message #191611 is a reply to message #191602] |
Tue, 17 April 2007 22:05  |
Eclipse User |
|
|
|
Originally posted by: kosta.bea.com
Joe,
If you have the freedom to keep your directory structure in CVS the same
as what's used in Eclipse, then I would definitely recommend that you do
that. Your team members will have much easier time pulling the project
down from CVS into their own Eclipse workspaces.
Regarding the build directory vs. the WEB-INF/classes directory
question, this layout is used to make it easier for people to keep
source and generated artifacts separate. You don't want to be submitting
the build directory to your SCM system. When you are ready to package
your WAR, you can do that using the "File -> Export -> Web -> WAR file"
wizard. The wizard will make sure the app is compiled and package it
correctly.
- Konstantin
|
|
|
Powered by
FUDForum. Page generated in 0.03663 seconds