This chapter describes how to create a package to distribute your extension.
This chapter includes the following sections:
The steps to package and deploy an extension are as follows:
First, you create an extension package which consists of a JAR that is packaged in an extension bundle archive. The extension bundle archive is a JAR file containing the extension JAR and any supporting files used by the extension.
The extension JAR file contains:
The extension manifest file extension.xml
.
Compiled class files and resources in the same directory structure they had while they were being developed.
The extension bundle archive contains:
One or more extension JAR files.
Any supporting files such as library JAR files.
Next, you package the extension JAR files into a .zip
file for distribution.
If this is the first time you have opened the project in JDeveloper, for example if you are migrating an extension written for an earlier version of JDeveloper, right-click the project in the Application Navigator and choose Deploy to Target Platform. This generates the bundle manifest manifest.mf
if one does not already exist. You may need to refresh the Application Navigator.
If the extension references external libraries, open the bundle manifest manifest.mf
by locating it in the Application Navigator under the META-INF node, and change the line
Bundle-ClassPath: .
so that it says:
Bundle-Classpath: .,external:jdev-install/jdeveloper/jdev/extensions/library
When you create an extension project, an extension deployment profile to create an OSGi bundle is also created. For more information, see "Deployment Profiles" in Oracle Fusion Middleware User Guide for Oracle JDeveloper.
You set the OSGi bundle profile parameters from the Project Properties dialog.
To edit the deployment profile:
In the Application Navigator, right-click the project, then choose Properties. Alternatively, choose Project Properties from the Application menu.
Select Deployment in the panel on the left of the Project Properties dialog. The extension profile Extension (Extension JAR)
is selected. Click Edit.
In the Bundle Options page of the OSGi Bundle Profile dialog, you can enter details such as the bundle name, version, and activator. For more help at any time, press F1 or click Help from the dialog.
You set dependencies and set libraries for inclusion by choosing other pages in the dialog. For more information, see Section 1.8.1, "Understanding Dependencies."
Click OK when you are finished editing the deployment profile properties.
Once you have edited the deployment profile you can create the OSGi Bundle.
In the Application Navigator, right-click the extension project and choose Deploy > extension-profile to open the Deploy Extension dialog.
The option Deploy to OSGi Bundle is selected. You can click Next to examine details of the bundle that will be created in the Summary page. When you are satisfied, click Finish.
The OSGi bundle containing your extension is created in the Oracle-home/jdeveloper/jdev/extensions
directory.
You can run and debug the OSGi bundle from this location automatically. For more information, see Chapter 4, "Testing and Debugging Extensions."
Extensions can be distributed to a team by making them available on a file system, and having users install the extension using the Check for Updates wizard available from the Help menu. For more information, see "Working with Extensions" in Oracle Fusion Middleware User Guide for Oracle JDeveloper
Alternatively, you can make an extension available to a wider audience by hosting it on the Web somewhere, or you could have it hosted as an open source project so that other people can help you enhance your extension and further develop it.
Oracle hosts some JDeveloper third party extensions, which are available at http://www.oracle.com/technetwork/developer-tools/jdev/index-099997.html
. If you would like to upload your extension to this site, post a message on the JDeveloper and ADF forum at http://forums.oracle.com/forums/forum.jspa?forumID=83
.