Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Why is setting up project dependencies so hard?
Why is setting up project dependencies so hard? [message #184297] Sun, 10 December 2006 16:08 Go to next message
Eclipse UserFriend
Originally posted by: ns_dkerber.ns_WarrenRogersAssociates.com

Using Eclipse 3.2.

I have a webapp project that has a grand total of 2 jsp's in it, and
uses the .java files (which are deployed as a .jar) in another project
to provide some of its functionality. This java project is also used in
other webapp projects, so I keep it separate, rather than putting it
into each webapp that needs its functions, and deploy it as a .jar file.

It seems intuitive that I should be able to just go into the webapp
projet's properties and select the .jar project as a reference, and have
everything work. But it doesn't. I also need to go into the java build
path and put this project in both the "Projects" and "Order and export"
tabs, in order for me to be able to debug my project in Eclipse.

Why are there so many steps required? Why can't I do just one setting
and have it work? I understand that deploying may have additional
settings required, but for debugging it doesn't make sense.

Is there a document somewhere that will explain when and why I need to
use those various settings?

I also have additional issues with deploying the utility .jar file, but
I'll ask about that in a separate post.

--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
Re: Why is setting up project dependencies so hard? [message #184315 is a reply to message #184297] Mon, 11 December 2006 04:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse5.rizzoweb.com

David Kerber wrote:
> Using Eclipse 3.2.
>
> I have a webapp project that has a grand total of 2 jsp's in it, and
> uses the .java files (which are deployed as a .jar) in another project
> to provide some of its functionality. This java project is also used in
> other webapp projects, so I keep it separate, rather than putting it
> into each webapp that needs its functions, and deploy it as a .jar file.
>
> It seems intuitive that I should be able to just go into the webapp
> projet's properties and select the .jar project as a reference, and have
> everything work. But it doesn't. I also need to go into the java build
> path and put this project in both the "Projects" and "Order and export"
> tabs, in order for me to be able to debug my project in Eclipse.
>
> Why are there so many steps required? Why can't I do just one setting
> and have it work? I understand that deploying may have additional
> settings required, but for debugging it doesn't make sense.

First, remember that the core Eclipse is not Java-specific. With that in
mind, the Project References is part of the "core" platform and is not
Java-aware.
I seldom use the "base" Project References - what you really want is the
Java Build dependency. I know that the project build order is computed
based in part on the Project References, but I've never had an issue
with ignoring that setting altogether.

Hope this helps,
Eric
Re: Why is setting up project dependencies so hard? [message #184357 is a reply to message #184297] Mon, 11 December 2006 14:06 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
Adding the utility project should be one step, provided you use the J2EE
Module Dependencies page of the webapp project's properties. Checking
the project there will cause the utility project's classes to be
combined into a jar and that jar included in the webapp's WEB-INF/lib
when the webapp is published to a server or exported as a war. It also
automatically includes the utility project's classes in the Java Build
Path of the webapp project via the Web App Libraries library folder.

Cheers,
Larry

David Kerber wrote:
> Using Eclipse 3.2.
>
> I have a webapp project that has a grand total of 2 jsp's in it, and
> uses the .java files (which are deployed as a .jar) in another project
> to provide some of its functionality. This java project is also used in
> other webapp projects, so I keep it separate, rather than putting it
> into each webapp that needs its functions, and deploy it as a .jar file.
>
> It seems intuitive that I should be able to just go into the webapp
> projet's properties and select the .jar project as a reference, and have
> everything work. But it doesn't. I also need to go into the java build
> path and put this project in both the "Projects" and "Order and export"
> tabs, in order for me to be able to debug my project in Eclipse.
>
> Why are there so many steps required? Why can't I do just one setting
> and have it work? I understand that deploying may have additional
> settings required, but for debugging it doesn't make sense.
>
> Is there a document somewhere that will explain when and why I need to
> use those various settings?
>
> I also have additional issues with deploying the utility .jar file, but
> I'll ask about that in a separate post.
>
Re: Why is setting up project dependencies so hard? [message #184401 is a reply to message #184357] Mon, 11 December 2006 17:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ns_dkerber.ns_WarrenRogersAssociates.com

In article <eljol2$hno$1@utils.eclipse.org>, Larry.Isaacs@sas.com
says...
> Adding the utility project should be one step, provided you use the J2EE
> Module Dependencies page of the webapp project's properties. Checking
> the project there will cause the utility project's classes to be
> combined into a jar and that jar included in the webapp's WEB-INF/lib
> when the webapp is published to a server or exported as a war. It also
> automatically includes the utility project's classes in the Java Build
> Path of the webapp project via the Web App Libraries library folder.

I'll give that a try; thanks. Is this explained anywhere in the docs?
I couldn't find it.

....

> > I have a webapp project that has a grand total of 2 jsp's in it, and
> > uses the .java files (which are deployed as a .jar) in another project
> > to provide some of its functionality. This java project is also used in
> > other webapp projects, so I keep it separate, rather than putting it
> > into each webapp that needs its functions, and deploy it as a .jar file.
> >
> > It seems intuitive that I should be able to just go into the webapp
> > projet's properties and select the .jar project as a reference, and have
> > everything work. But it doesn't. I also need to go into the java build
> > path and put this project in both the "Projects" and "Order and export"
> > tabs, in order for me to be able to debug my project in Eclipse.
> >
> > Why are there so many steps required? Why can't I do just one setting
> > and have it work? I understand that deploying may have additional
> > settings required, but for debugging it doesn't make sense.
> >
> > Is there a document somewhere that will explain when and why I need to
> > use those various settings?
> >
> > I also have additional issues with deploying the utility .jar file, but
> > I'll ask about that in a separate post.
> >
>

--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
Re: Why is setting up project dependencies so hard? [message #184422 is a reply to message #184401] Mon, 11 December 2006 19:32 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
If you search the Help Content for "J2EE Module Dependencies", the first
hit will give you what exists as far as I know. Unfortunately, it's not
much and not all that helpful.

Somewhat similar to what Eric Rizzo mentioned in his e-mail, the thing
to be aware of is that the Java support provided by Eclipse JDT does not
include support for J2EE. This means that things you do in a Java
project will have the same effect when done in a Dynamic Web Project.
For example, adding a jar directly to the Java Build Path in an Java
project won't cause it to be included in the WEB-INF/lib of the project
(the fact that the Java project doesn't have one not withstanding).
Likewise, adding a jar directly to the Java Build Path of a Dynamic Web
Project doesn't cause the jar to be included to the WEB-INF/lib of the
project, even though the project does have a WEB-INF/lib. As much as it
might make sense in the context of a Dynamic Web Project, the Java Build
Path settings are simply unaware of such a thing as a WEB-INF/lib.
Something outside of JDT must be provided by WTP to cover the inclusion
of dependencies in WEB-INF/lib. The J2EE Module Dependencies page is
where this functionality exists. In addition to handling the
WEB-INF/lib dependency aspect, it also automatically deals with the JDT
aspect of including it on the Java Build Path (via Web App Libraries).

Cheers,
Larry

David Kerber wrote:
> In article <eljol2$hno$1@utils.eclipse.org>, Larry.Isaacs@sas.com
> says...
>> Adding the utility project should be one step, provided you use the J2EE
>> Module Dependencies page of the webapp project's properties. Checking
>> the project there will cause the utility project's classes to be
>> combined into a jar and that jar included in the webapp's WEB-INF/lib
>> when the webapp is published to a server or exported as a war. It also
>> automatically includes the utility project's classes in the Java Build
>> Path of the webapp project via the Web App Libraries library folder.
>
> I'll give that a try; thanks. Is this explained anywhere in the docs?
> I couldn't find it.
>
> ...
>
>>> I have a webapp project that has a grand total of 2 jsp's in it, and
>>> uses the .java files (which are deployed as a .jar) in another project
>>> to provide some of its functionality. This java project is also used in
>>> other webapp projects, so I keep it separate, rather than putting it
>>> into each webapp that needs its functions, and deploy it as a .jar file.
>>>
>>> It seems intuitive that I should be able to just go into the webapp
>>> projet's properties and select the .jar project as a reference, and have
>>> everything work. But it doesn't. I also need to go into the java build
>>> path and put this project in both the "Projects" and "Order and export"
>>> tabs, in order for me to be able to debug my project in Eclipse.
>>>
>>> Why are there so many steps required? Why can't I do just one setting
>>> and have it work? I understand that deploying may have additional
>>> settings required, but for debugging it doesn't make sense.
>>>
>>> Is there a document somewhere that will explain when and why I need to
>>> use those various settings?
>>>
>>> I also have additional issues with deploying the utility .jar file, but
>>> I'll ask about that in a separate post.
>>>
>
Re: Why is setting up project dependencies so hard? [message #185715 is a reply to message #184422] Sat, 06 January 2007 06:15 Go to previous message
David Williams is currently offline David WilliamsFriend
Messages: 722
Registered: July 2009
Senior Member
On Mon, 11 Dec 2006 14:32:00 -0500, Larry Isaacs <Larry.Isaacs@sas.com> wrote:

> Unfortunately, it's not much and not all that helpful.


Remember, bugs/enhancements can be opened against "documentation" component ....
and "patches" (or, heck, even just some suggested prose :) from experts like you would be
very helpful!
Previous Topic:XML File Validation Using NameSpace
Next Topic:generate XML schema from XML document?
Goto Forum:
  


Current Time: Tue Mar 19 04:20:30 GMT 2024

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

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

Back to the top