|jar file creation and deployment questions [message #877092]
||Fri, 25 May 2012 17:18
| Marc Chamberlin
Registered: July 2009
Hello - I have some Eclipse usage questions and would like to know if |
there is a structured way in Eclipse/Webtools that would solve these
annoyances. I suspect there is, probably using technology that I have
not yet learned about or how to use. If so, could someone provide me
with pointers to tutorials or docs that would show me how to solve the
I have several dynamic web projects defined, each of which are used to
define a WAR file for deployment to some Tomcat server. In support of
these web projects we have a number of additional separate supporting
projects that are used to define and create collections of things like
servlets, applets/web apps, data transporters, general utilities etc.
These are simple java projects that are packaged into jar files for
usage in one or more of the dynamic web projects.
My questions are as follows -
1. Is there a mechanism in Eclipse that will automate the creation of
the jar file for each project, each time the project is built? At the
moment, we have to remember to click on the .jardesc jar file descriptor
in order to create the jar file for the project. This gets rather
annoying when one is doing iterative development and/or debugging.
Pointers to examples on how to do this would be much appreciated!
2. We had to configure the .jardesc files to warn about overwriting
files in order to avoid needlessly updating the .jardesc file (which
does not typically change) and thus avoiding needless CVS updates when a
project is checked in. It becomes annoying to have to say yes to
overwriting the .jar file, and no to overwriting the .jardesc file
every time we need to recreate the .jar file. Also, we discovered a
Catch22! One can check the box that will "Save the description of this
jar file in the workspace" but one cannot uncheck that box and have that
state of not saving the .jardesc permanently preserved in a .jardesc
file, since it will NOT be written out at all! Therefore, unchecking
that box is not a solution. So if there is a way to automate the
creation of .jar files, when we do a build, it would be really nice to
be able to avoid these overwrite questions as well.
3. For many of the jar files, we have to deploy them to multiple dynamic
web projects. To accomplish that, we have to create multiple .jardesc
files and execute them, since apparently a .jardesc file can only create
one jar file in one location. Or we have to copy/paste these jar files
from one project to another. Again a hassle and easy to forget this
step, so is there a way to automate this as well?
4. The publish mechanism for Tomcat seems to only recognize the need to
republish a dynamic web project when it detects a change has occurred
directly in one or more of the files (including jar files) within that
dynamic web project itself. Why doesn't the Tomcat server project detect
the need to publish when a jar file it depends on is recreated in one of
the supporting projects? It seems that in the Web Deployment Assembly,
for a dynamic web project, we define where jar files come from. So it
would seem that the Tomcat deployment mechanism should have enough
information to detect that a jar file created in another project has
changed, and therefore it needs to be republished. Right now, we have to
remember to force a republish which again is a hassle and an easy step
5. The Web Deployment Assembly will only deploy jar files to the
WEB-INF/lib directory. How does one handle (automatically) the
deployment of jar files needed for applets/webapps? These cannot be
deployed to the WEB-INF/lib directory since the Tomcat server will not
allow user/client access to this directory. So they must be deployed to
somewhere else within a dynamic web project that is accessible by a
client. Is there any way to again automate the creation and deployment
of these kind of jar files?
Thanks in advance for any pointers/help... Marc..