This recipe describes how to add classes to be used inside JDeveloper projects, especially in SOA projects.
We build this recipe on top of the Adding custom classes to the SOA Suite server recipe. We will add the SOA composite project where we utilize the classes for calculating loan parameters.
To add custom classes to the JDeveloper project, we need to copy the libraries to the SCA-INF/classes
directory. That way, the custom classes are included in the build phase and deployment phase of the project.
The SOA projects in JDeveloper have a placeholder (SCA-INF/classes
) where we put the custom classes. This also ensures that libraries are picked by the build process which packs the libraries into the deployment package.
The procedure we described in this recipe can be taken into account when we don't have the same set of custom classes already deployed in the Oracle SOA Suite server. In cases where the custom classes already exist in the Oracle SOA Suite server, the following section describes other options with which to add custom classes to the JDeveloper projects:
Right-click on the project LibsAndClasses and select Project Properties. From the tree in the dialog, select Libraries and Classpath and then click on the Add JAR/Directory... button. At the opened dialog, search for the directory that holds the custom classes and click on the Select button. We can see how a new custom class directory has appeared under the classpath entries in the project properties dialog: