Deployment Plans
Deployment plans can be used by administrators to override application settings and variables without modifying the actual jar/war/ear file contents.
Creation
Creating a deployment plan for a deployed application.
- Open a Web browser and go to http://<hostname>:<port>/console.
- Log in as the administrator.
- In the Change Center, click Lock & Edit to enable configuration changes.
- Navigate to <domain_name>, then Deployments.
- Click on the <application_name> you are creating a deployment plan for.
- Click on the Configuration tab.
- Click Save.
- Enter the path and name of the deployment plan and Click OK.
- In the Change Center, click Release Configuration.
Customization
Customizing a deployment plan involves 2 parts, creating variables and assigning them.
Creating Variables:
Variable definitions should be entered below <application-name> inside the <variable-definition> tag.
Each variable requires a <name> and <value> tag.
Example:
<application-name>upload</application-name> <variable-definition> <variable> <name>secureCookie</name> <value>true</value> </variable> </variable-definition>
Assigning Variables:
Variable assignment needs to take place in the correct <root-element>, which in most cases is weblogic-web-app.
Depending on the variable assignment, it needs to be in the correct <uri> tag. The example below shows a variable assignment which would normally exist in the WEB-INF/weblogic.xml file.
Each variable assignment requires a <name> and <xpath>. The <name> is the name of the variable with a value created above and the <xpath> is the context path or tags in which the variable exists.
So normally in the weblogic.xml file this would look like:
<weblogic-web-app> <session-descriptor> <cookie-secure>SOME_VALUE</cookie-secure> </session-descriptor> </weblogic-web-app>
But in the <xpath> each tag is separated by a / resulting in:
/weblogic-web-app/session-descriptor/cookie-secure
Example:
<root-element>weblogic-web-app</root-element> <uri>WEB-INF/weblogic.xml</uri> <variable-assignment> <name>secureCookie</name> <xpath>/weblogic-web-app/session-descriptor/cookie-secure</xpath> </variable-assignment>
Full Deployment Plan Example:
<?xml version='1.0' encoding='UTF-8'?> <deployment-plan xmlns="http://xmlns.oracle.com/weblogic/deployment-plan" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/deployment-plan http://xmlns.oracle.com/weblogic/deployment-plan/1.0/deployment-plan.xsd"> <application-name>upload</application-name> <variable-definition> <variable> <name>secureCookie</name> <value>true</value> </variable> </variable-definition> <module-override> <module-name>SOME_APPLICATION.ear</module-name> <module-type>ear</module-type> <module-descriptor external="false"> <root-element>weblogic-application</root-element> <uri>META-INF/weblogic-application.xml</uri> </module-descriptor> <module-descriptor external="false"> <root-element>application</root-element> <uri>META-INF/application.xml</uri> </module-descriptor> <module-descriptor external="true"> <root-element>wldf-resource</root-element> <uri>META-INF/weblogic-diagnostics.xml</uri> </module-descriptor> </module-override> <module-override> <module-name>SOME_APPLICATION.war</module-name> <module-type>war</module-type> <module-descriptor external="false"> <root-element>weblogic-web-app</root-element> <uri>WEB-INF/weblogic.xml</uri> <variable-assignment> <name>secureCookie</name> <xpath>/weblogic-web-app/session-descriptor/cookie-secure</xpath> </variable-assignment> </module-descriptor> <module-descriptor external="false"> <root-element>web-app</root-element> <uri>WEB-INF/web.xml</uri> </module-descriptor> </module-override> <config-root>DOMAIN_HOME/servers/AdminServer/upload/plan</config-root> </deployment-plan>