# Using Deployment Plan Editor

Using a deployment plan, you can optionally define or override Oracle WebLogic Server tuning parameters to optimize the use of resources in the target environment.

## Overview of a Sample Application

The sample application used in this section is a Java EE Ear project with a single Web module. The context root of the Web module is defined in the `weblogic.xml` file. This document describes steps that you take to create and edit a WebLogic deployment plan to override the context root with a custom value.

## Creating a New Deployment Plan

Using OEPE, you can create a new deployment plan by following this procedure:

1. Open the Java EE perspective by selecting Window > Open Perspective > Other > Java EE from the Eclipse IDE main menu.

2. Right-click the Project Explorer and select New > Other from the drop-down menu. On the New dialog, select WebLogic Descriptors > WebLogic Deployment Plan, and then click Next. This opens the File Name and Location dialog.

3. On the File Name and Location dialog, select the parent folder and provide the name for your deployment plan, and then click Next.

4. On the next Target Application and Options screen, select the target application, target `Oracle WebLogic Server runtime`, optionally specify whether or not to invoke `weblogic.PlanGenerator` to generate default variable definitions, and then click Finish.

   For more information about `weblogic.PlanGenerator`, see "weblogic.PlanGenerator Command Line Reference" in Deploying Applications to Oracle WebLogic Server.

Upon the completion, the New WebLogic Deployment Plan wizard opens the deployment plan in the deployment plan editor for further modifications.

## Editing a Deployment Plan

OEPE provides a graphical design view that you can use to edit your WebLogic deployment plan.

The editor consists of the following parts:

- A tree control on the left.

- An edit page on the right - when you select a node in the tree, the editor will display an appropriate edit page.

The tree control is represented by the following main nodes:

- General - lets you modify the application name, server and deployment plan versions, the external configuration root, and provide the deployment plan description.

- Variable Definitions - lets you define new variables. To create a new variable, select the Variable Definitions node, and then click + (Add) on the edit page to expand the area

- Modules - lets you specify existing or add new modules by clicking Add a module override.

Click Browse next to the Module Name field to open the Module Name dialog. Select an existing module or add a module override to the deployment plan.

To add a deployment descriptor, click Add a descriptor on the Modules editor page.

Specify the descriptor URI by clicking Browse next to the URI field on the Descriptor editor page. This will display the Select the URI of the descriptor dialog,.

Using the Select the URI of the descriptor dialog, select the `weblogic.xml` file, and then click OK.

To add a new variable assignment, click + (Add) on the Variable Assignments > Specify the XPath area.

Use the XPath Expression Builder dialog to navigate the element that you want to override in the descriptor, and then click OK to select the XPath.

Click Browse next to the Variable name field to display the Variable Name dialog and select the variable name to assign.

Select the Replace operation on the Variable Assignments edit page.

Use the Clean Up Deployment Plan utility to remove unassigned variables from your plan's XML file. To do so, click the Clean Up button represented by a green check mark icon located in the top right corner of the editor. Make your selection from the list of the potential clean up candidates, and then click Finish to remove these elements from your deployment plan.

You can also switch to the source view of your WebLogic deployment plan to edit it manually.

## Using an Existing Deployment Plan to Configure an Application

You can use the generated deployment plan with the following weblogic.Deployer command:

    java weblogic.Deployer -adminurl t3://localhost:7001 -username weblogic -password weblogic7001 -plan plan.xml -deploy MyNewWSProjectEAR.ear

Alternatively, you can use Eclipse IDE to specify this information in the WebLogic Server Editor when deploying to a remote server.

Use the Choose a deployment plan dialog to select the deployment plan.