Home » Language IDEs » ServerTools (WTP) » Building a .war
Building a .war [message #160122] |
Fri, 10 February 2006 09:57  |
Eclipse User |
|
|
|
Originally posted by: ns_dkerber.ns_WarrenRogersAssociates.com
Why is building a .war such a pain?? I have 3 libraries which the
project depends on, two of which are standard ones (activation.jar and
mail.jar), and one of which is a .jar from another java project.
Because these libraries are used in other projects as well, I deploy
them to the /shared/lib directory of my Tomcat server. Therefore, I
don't want them to be in my .war file. The problem is that in order to
get them out of the .war, I have to completely remove them from the
dynamic web project definition (in the java build path, the j2ee module
dependencies and the web-inf/lib folder). Why can't there be an option
setting to build just the classes and files which are a direct part of
this project, leaving out the .jars it depends on. It gets to be a big
PITA to remove the dependencies, build the .war, and then add them back
in before I can debug the project again through eclipse.
Or is there a setting I'm missing somewhere that would handle all this
for me?
There are other issues I have with dynamic web project dependencies that
I had hoped were going to be cleaned up in Eclipse 3.2 and WTP 1.5, but
it doesn't look like that's going to happen. Or at least it hasn't yet
in the M and I builds.
--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
|
|
|
Re: Building a .war [message #160186 is a reply to message #160122] |
Fri, 10 February 2006 12:57   |
Eclipse User |
|
|
|
Originally posted by: jazeltine.sbcglobal.net
David Kerber <ns_dkerber@ns_WarrenRogersAssociates.com> wrote in
news:MPG.1e5673e8a5f1a8449896c4@news.eclipse.org:
> Why is building a .war such a pain?? I have 3 libraries which the
> project depends on, two of which are standard ones (activation.jar and
> mail.jar), and one of which is a .jar from another java project.
>
> Because these libraries are used in other projects as well, I deploy
> them to the /shared/lib directory of my Tomcat server. Therefore, I
> don't want them to be in my .war file. The problem is that in order
to
> get them out of the .war, I have to completely remove them from the
> dynamic web project definition (in the java build path, the j2ee
module
> dependencies and the web-inf/lib folder). Why can't there be an
option
> setting to build just the classes and files which are a direct part of
> this project, leaving out the .jars it depends on. It gets to be a
big
> PITA to remove the dependencies, build the .war, and then add them
back
> in before I can debug the project again through eclipse.
>
> Or is there a setting I'm missing somewhere that would handle all this
> for me?
>
>
> There are other issues I have with dynamic web project dependencies
that
> I had hoped were going to be cleaned up in Eclipse 3.2 and WTP 1.5,
but
> it doesn't look like that's going to happen. Or at least it hasn't
yet
> in the M and I builds.
>
I think what you may be looking for is the option to use variables in
the Eclipse build path. This gives the compiler acccess to external jars
without actually bringing them into the workspace. Once you have the
properties for your project open, and you have clicked on Java Build
Path, click on the Libraries tab. You can use the Add Variable button to
pop a new dialog. On that dialog, you click the Configure Variables...
button which pops yet another dialog, and once there the New button will
get you where you need to go. Once back on the Java Build Path page,
click on the Order and Export tab, and choose the classpath position of
your entry. If you don't want it to be exported, just make sure the box
isn't checked next to your new entry.
Another option I have used in the past is to create a project that just
has jar files in it. Then when you are on the Java Build Path page of
the project you want to add them to, you can click the Projects tab, and
put a check next to the project that contains the jars. This will make
Eclipse happy while compiling, running, and debugging without having
them be included when you jar or war.
HTH!
Jim
|
|
|
Re: Building a .war [message #160223 is a reply to message #160186] |
Fri, 10 February 2006 13:38  |
Eclipse User |
|
|
|
Originally posted by: ns_dkerber.ns_WarrenRogersAssociates.com
In article <Xns9766653C1FE5Ejamesrazeltinesaicco@206.191.52.34>,
jazeltine@sbcglobal.net says...
....
> I think what you may be looking for is the option to use variables in
> the Eclipse build path. This gives the compiler acccess to external jars
> without actually bringing them into the workspace. Once you have the
> properties for your project open, and you have clicked on Java Build
> Path, click on the Libraries tab. You can use the Add Variable button to
> pop a new dialog. On that dialog, you click the Configure Variables...
> button which pops yet another dialog, and once there the New button will
> get you where you need to go. Once back on the Java Build Path page,
> click on the Order and Export tab, and choose the classpath position of
> your entry. If you don't want it to be exported, just make sure the box
> isn't checked next to your new entry.
> Another option I have used in the past is to create a project that just
> has jar files in it. Then when you are on the Java Build Path page of
> the project you want to add them to, you can click the Projects tab, and
> put a check next to the project that contains the jars. This will make
> Eclipse happy while compiling, running, and debugging without having
> them be included when you jar or war.
>
> HTH!
It certainly did!! I went the path variables route, and it worked
great. I still have to check and uncheck my java project when building
the .war (because I deploy its jar separately instead of inside the
..war), but I think that's to be expected with a J2EE project, which
seems to want everything in one place.
Thanks for the help!
--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
|
|
|
Goto Forum:
Current Time: Thu Mar 27 16:41:59 EDT 2025
Powered by FUDForum. Page generated in 0.03195 seconds
|