5 Packaging and Deploying Extensions

This chapter describes how to create a package to distribute your extension.

This chapter includes the following sections:

5.1 About Packaging and Deploying Extensions

The steps to package and deploy an extension are as follows:

  1. 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.

  2. Next, you package the extension JAR files into a .zip file for distribution.

  3. 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.

  4. 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

5.2 Packaging the Extension

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.

5.2.1 How to Create the Deployment Profile

You set the OSGi bundle profile parameters from the Project Properties dialog.

To edit the deployment profile:

  1. In the Application Navigator, right-click the project, then choose Properties. Alternatively, choose Project Properties from the Application menu.

  2. Select Deployment in the panel on the left of the Project Properties dialog. The extension profile Extension (Extension JAR) is selected. Click Edit.

  3. 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.

5.2.2 How to Create the OSGi Bundle

Once you have edited the deployment profile you can create the OSGi Bundle.

To create the OSGi Bundle:

  1. In the Application Navigator, right-click the extension project and choose Deploy > extension-profile to open the Deploy Extension dialog.

  2. 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."

5.3 Deploying an Extension

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.