Working With Project References
See Also
To use artifacts from an XML file in a different project, add a project as a project reference to your source project. For example, if you have a BPEL Module project in which you want to use artifacts from an XML filesuch as an XML Schema or WSDL filein a Java Application project, you must add the Java Application project as a project reference to your source project, in this example, the BPEL Module project.
In some cases, you may need to change project references in your project. This may happen if you need to change the dependency of one project to another project to be able to use XML file artifacts from a new project. In this case, you need to remove the old project reference and add a new project reference so you can use XML file artifacts from the new project.
Adding Project References
To add a project reference:
- In the Projects window, select the project node for the project where you want to add a project reference.
- Right-click the node and choose Properties.
The Project Properties dialog box opens.
- In the Categories list, select the Project References node.
The right panel of the dialog box now contains a Project References box.
- Click the Add Project button.
The Add Project dialog box opens.
- Navigate to and select the project you want to add as a project reference and click Add Project.
Note: You can only select BPEL Module projects, XSLT Module projects, SQL Module projects, Web Application projects, EJB Module projects, and Java Application projects.
The Project References box of the Project Properties dialog box now contains the name of the project you selected.
- Click OK to close the Project Properties dialog box.
Cyclic References
You can add multiple projects as Project References to your source project, as long as the references are not cyclic.
For example, assume you have 3 projects: a BPEL Module project called BPEL-1, a sample SOA BluePrint project called BluePrint-1, and a Web application project called WebApp-1.
Now let's assume you add the following project references:
- For BluePrint-1, add WebApp-1 as a project reference.
- For BPEL-1, add BluePrint-1 and WebApp-1 as project references.
After adding the project references shown above, if you try to add BPEL-1 as a project reference in the BluePrint-1 project, the IDE will not let you do this because it is a cyclic reference. The BluePrint-1 project is already a project reference in the BPEL-1 project.
Removing Project References
When you remove a project reference, the IDE will warn you if there are references to files in the project you are removing.
To remove a project reference:
- In the Projects window, select the project node for the project where you want to remove a project reference.
- Right-click the node and choose Properties.
The Project Properties dialog box opens.
- In the Categories list, select the Project References node.
The right panel of the dialog box now contains a Project References box, with the list of project references.
- In the Project References box, select the reference you want to remove and click Remove.
If there are references to files in this project, the IDE warns you about this and you must confirm that you want to remove the project reference.
- If a warning dialog box opens, click Yes to remove the project reference.
After you remove a project reference, you use the XML Catalog node in the Project Properties dialog box to remove XML catalog entries that were created by referencing external artifacts.
To remove an XML catalog entry:
- In the Projects window, select the project node for the project.
- Right-click the node and choose Properties.
The Project Properties dialog box opens.
- In the Project Properties dialog box, in the Categories list, select the XML Catalog node.
- Under XML Catalog Entries, select the entry to remove and click Remove.
- See Also
- About Cross-Project XML File References
- Using Cross-Project XML File References
- Refreshing Cached XML File References
Legal Notices