Referring to other projects

These steps are necessary only if you work with a WebSphere® Portal test environment server and you want to run or debug portlet projects which refer to other projects in your workspace.

  1. Add required projects to the Java™ Build Path and Project References.
    1. In the Project Explorer view, right-click the portlet project and select Properties.
    2. In the left pane, select Java Build Path.
    3. Select the Projects tab.
    4. Select all required projects.
    5. In the left pane, select Project References.
    6. Select the projects that are referenced by the other projects.
      Note: Indirect or nested project references are not supported. That is, if a portlet project references a Java project, and the Java project references a second Java project, the portlet project will not have access to the second Java project unless you also include the second Java project in the list of Project References.
    7. Click OK.
  2. If the required projects are EJB projects, follow these steps:
    1. Add all required projects to the EAR project for the portlet project.
      1. In the Project Explorer view, expand the EAR project.
      2. Double-click the EAR Deployment Descriptor to open its editor.
      3. Select the Module tab.
      4. In the Modules section, click Add to add a project to use.
      5. Click Finish.
      6. Add other required projects by following the steps above.
      7. Press Ctrl + S to save the data.
      8. Click OK if the Repair Server Configuration dialog box appears.
    2. Add Java JAR dependencies:
      1. In the Project Explorer view, right-click the portlet project and select Properties.
      2. Select the Java JAR Dependencies page.
      3. Select Use EJB JARs or Use EJB client JARs or Allow both.
      4. Select the JAR files from the list and click OK.
    3. Add all required projects to the server:
      1. In the Servers view, right-click the server and select Add and remove projects.
      2. Remove unneeded projects from the Configured projects list box using the Remove or Remove All buttons.
      3. Move the appropriate projects from the Available projects list to the Configured projects list using the Add or Add All buttons.
      4. Click Finish.

(C) Copyright IBM Corporation 2002, 2005. All Rights Reserved.