It's not a secret anymore!
The moose likes IDEs, Version Control and other tools and the fly likes Eclipse Project Dependencies etc Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Eclipse Project Dependencies etc" Watch "Eclipse Project Dependencies etc" New topic

Eclipse Project Dependencies etc

Nadine McKenzie
Ranch Hand

Joined: Feb 15, 2002
Posts: 53
Can someone tell me exactly what is the purpose of "project references" in Eclipse. I'm setting up project dependencies and I'm going through what seems to me a whole ceremony. I'd really like some literature that explains what all these do. I'm seeing alot of literature that says what to do but not why it is done and what it does behind the scenes.

Project Dependencies,
Java Build Path/Projects
Java Build Path/Order and Export

Also, why in addition to these do I have to
add folders in the Server Properties and
modify the application.xml?

Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

I feel your pain, Nadine. Let's move this over to our IDEs, Version Control, and other tools forum and see what people have to say.


[Jess in Action][AskingGoodQuestions]
Gerardo Tasistro
Ranch Hand

Joined: Feb 08, 2005
Posts: 362
Nadine, my main use for this is having one or two core projects. The ones that hold all my main business logic and data structures (read beans). Plus all the Hibernate related hbm files.

All my projects then include a core project. These projects then become basically just front ends and controller to implement some functionality. This allows me to:

-Easily add mature code to a new project
-Keep the core code in a CVS repository separate from the actual applications. This makes it really easy to modify core code, to work in teams and to quickly propagate these changes throught all projects.
-Keep a standard set of data structure and tools throughout my applications
-Establish a place to put commonly used code (classes used too often are moved to the core project [Eclipse refactors all references to them])

Hope that helps.
Nadine McKenzie
Ranch Hand

Joined: Feb 15, 2002
Posts: 53
The reason why I was asking these questions is because my problem actually goes deeper. I have (say for the sake of simplicity) 3 projects. myWeb, coreWeb and myEar. Both use struts 1.1 and this jar is in the lib of each project. When I set up project dependencies, there are no build errors, however, I am seeing a runtime error:

RpeRequestProcessor sits in myWeb and extends CoreRequestProcessor which sits in coreWeb. CoreRequestProcessor extends TilesRequestProcessor.

myWeb has Project References to coreWeb, and myEar.
myWeb's Java Build Path has coreWeb checked
myWeb's Order and Export has struts.jar and coreWeb checked (and in this order)

myEar has Project References to myWeb only.
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33127

The classloader problem has to do with your server settings. The war project has an incorrect classloader policy associated with it.

Are you using WSAD or Eclipse? If WSAD, you can change this in the server perspective. If Eclipse, it depends on your plugin/server.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Matt Solnit

Joined: Apr 10, 2006
Posts: 1
Hi everyone. I am trying to do the following. Can anybody help?

The scenario that I want is:
  • Project A produces a JAR file. This can be done using Eclipse or an integrated Ant task.
  • Project B, C, and D each produce a WAR. They depend on the JAR from project A. If it does not exist, Eclipse will build project A first.

  • I know how to do it so that the actual .class files from project A will be included in B.war, C.war, and D.war, but this produces bloat that I would like to avoid.

    Any suggestions?


    P.S. Because I am running on a new Intel MacBook Pro, I have to use the latest betas of Eclipse IDE and Web Tools Project (WTP). This is 3.2 and 1.5, respectively. Hope that's not a big problem :-)
    [ April 10, 2006: Message edited by: Matt Solnit ]
    Jeanne Boyarsky
    author & internet detective

    Joined: May 26, 2003
    Posts: 33127

    Why not put the jar from Project A into your WEB-INF/lib directory for the other projects?
    I agree. Here's the link:
    subject: Eclipse Project Dependencies etc
    jQuery in Action, 3rd edition