Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » WTP Best Practices?
WTP Best Practices? [message #178836] Sat, 09 September 2006 20:18 Go to next message
Eclipse User
Originally posted by: aeg.eclipse.somnia.com

Is there any document that describe the "best practices" for using WTP in
a multi-developer environment?

I've been an Eclipse user for years, and have followed the various
iterations of the WTP. However, I've always been hesitant to adopt a new
methodology when I've been productive with others.

At this point, we have out web-based configuration files (Struts XML,
Tiles, web.xml, etc) seperate from our source. These are divided by
directory for local, dev, and production environments. Individual ANT
scripts build source, copy HTML, JSP and the like, as well as the type of
configuration files required (whether for local or production builds).

To make a long story short, or current paradigm doesn't fit with the WTP
paradigm, and I don't know how (or if) I should try to squeeze the two
together. Since WTP creates and uses a WEB-INF directory directly within
the Web source, I don't know exactly how to proceed. Does the WTP team
believe these files should be checked in to CVS/SVN right along with the
HTML and JSP? If so, where should the production-level config files go,
since they are certainly different.

This, along with many other questions like it, have be a bit perplexed. I
don't want to blaze a new path of development tool integration glory if a
best-practices guide exists.

So, to bring this long post to a close, does one? I've read through the
documentation, but it only gives me the basics. I need a more in-depth
guide to the theory of development with WTP.
Re: WTP Best Practices? [message #178915 is a reply to message #178836] Mon, 11 September 2006 15:56 Go to previous messageGo to next message
Eclipse User
Originally posted by: kosta.bea.com

Lukas,

I am not aware of an actual best practices guide for WTP, but perhaps I
can help your resolve your particular problem...

WTP uses a configuration file to represent how your source maps to the
module that is being built. It is located in the .settings directory of
any WTP project and will either be called .component or
org.eclipse.wst.common.component depending on which build you are using.
In either case, if you open the file in a text editor you will see
entries such as:

<wb-resource deploy-path="/" source-path="/WebContent"/>

These entries are mappings from source tree to the module structure.
This particular one maps <project.dir>/WebContent directory to the root
of the the web module.

So... Here is one way that you can leverage this infrastructure to fit
your situation:

1. Place the various configuration files under the web project directory
using separate directories for each type of the configuration. For
instance, <project.dir>/configs/local, <project.dir>/configs/dev, etc.
You will want to source control these files along with your HTML and JSP
files to make sure that other members of your team can get access to them.

2. Add an entry to the file described above that looks like this. You
will have to figure out which of the configs makes the most sense to use
during development.

<wb-resource deploy-path="/WEB-INF" source-path="/configs/dev"/>

3. Remove the WEB-INF directory that WTP creates under the WebContent
directory.

You will want to perform the above steps with Eclipse shut down to avoid
any adverse reactions. One thing to be aware of is that if you use WTP
UI that modifies the descriptors, such as creating a new servlet, you
will need to manually propagate the change to the other versions of the
descriptors.

Hope this helps.

- Konstantin
Re: WTP Best Practices? [message #178973 is a reply to message #178836] Mon, 11 September 2006 22:12 Go to previous message
Hermann VoÃ?eler is currently offline Hermann VoÃ?eler
Messages: 12
Registered: July 2009
Junior Member
Lukas Bradley schrieb:
> At this point, we have out web-based configuration files (Struts XML,
> Tiles, web.xml, etc) seperate from our source. These are divided by
> directory for local, dev, and production environments. Individual ANT
> scripts build source, copy HTML, JSP and the like, as well as the type
> of configuration files required (whether for local or production builds).
>

Lukas,

just another hint: in our team, we use a separate SVN branch for the
production builds. So, basically, before every new release, there will
be a merge from developement line to the production branch and the person
doing the merge will review the changes that are about to go to Live.

This means the production versions of all config files are located on
the production branch only and a normal dev. setup will never see this
versions.

hope this helps,
Hermann
Previous Topic:"Java compiler level does not match the version of the installed Java project facet"
Next Topic:Adding the Server view to a product
Goto Forum:
  


Current Time: Fri Oct 24 14:57:13 GMT 2014

Powered by FUDForum. Page generated in 0.21617 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software