Getting Started with the Deployment Plans

From Wiki

Jump to: navigation, search


WebRatio gives you the chance to specify Deployment Plans in a Web project. This feature allows you to define and execute a set of tasks in order to automate the most common deployment operations (full project generation, WAR, removal of *.java source files, etc). To add a Deployment Plan, select the "Project" tab and right click on the "Project" node from the Outline View. Select the Add Deployment Plan command.

WebRatio automatically creates a standard Deployment Plan that you can modify as you want adding and removing tasks through the specific dialog.The dialog is composed by two lists:
  • the left list shows the available deployment tasks
  • the right list shows the tasks composing the deployment plan

Using the dialog's buttons it is possible to add and remove tasks in the right list, as well as reorder their sequence (choosing a task and clicking on the Up or Down button). Let's see which are the predefined tasks you can use:


The following tasks are available:

  • Image:ant.png Ant: executes a custom Ant build file stored in the Web project workspace folder
  • Image:clear.png Clear Deployment Folder: wipes out the deployment folder
  • Image:copy.png Copy Local WebApp: copies the contents of the current output folder (specified with the Output Path property of the Web Project) into the deployment folder
  • Image:delete.png Delete Hibernate Java Sources: removes the *.java Hibernate source files stored in the deployment folder under WEB-INF/classes
  • Image:generate.png Generate Full Web Project: fully generates the Web application in the deployment folder addressed by the two variables ${deploy_loc}/${project_name}. It's possible to choose one of the Deployment Configurations associated to the Web Project.
  • Image:jar.png JAR Descriptor Folder: packages the contents of the WEB-INF/descr folder with a single JAR file and stores it into WEB-INF/lib
  • Image:war.png WAR: packages the application into a Web application archive (WAR) file and stores it into the deployment folder. It's possible to choose the name of the WAR package and if to delete or not the deployment folder.


This list of tasks is limited to the most commons one. If you need to do custom operations you have to use the Ant task, which allows you to write your own Ant build file (in which you can specify the execution of any operation you want). You can find a guide to the Ant build file at the following link: Apache Ant User Manual. When you add an Ant deployment task WebRatio allows you to automatically create the related file just typing the name in the Build File property. The file will be created with some predefined content and it shows through comments some variables that you have at your disposal.


<?xml version="1.0" encoding="UTF-8"?>
<project name="Custom Deployment" default="main">
	<!--
	Available properties:
	${deployment_folder}
	${local_web_app_folder}
	${project_name}
	${project_folder}
	-->
	<target name="main">

	</target>

</project>

Suppose that you want to set the log level and the log folder of the deployed Web application using this custom Ant task. You can substitute the log configuration files contained in the deployment folder with other files, containing your settings, which can be stored for example in a folder in the Web Project. This is the code of the Ant task:

<?xml version="1.0" encoding="UTF-8"?>
<project name="Custom Deployment" default="main">
    <!--
      Available properties:
      ${deployment_folder}
      ${local_web_app_folder}
      ${project_name}
      ${project_folder}
    -->
    <target name="main">
      <copy file="${project_folder}/deployFiles/RTXLogConfig.properties" todir="${deployment_folder}/WEB-INF/conf" overwrite="true"/>
      <copy file="${project_folder}/deployFiles/StrutsLogConfig.properties" todir="${deployment_folder}/WEB-INF/conf" overwrite="true"/>
    </target>
</project>

Once you have structured the Deployment Plan you can execute it. To do this right click on the Deployment Plan and select the Execute Plan command.


Related articles:
Category Difficulty Refers
Getting Started with the Deployment Plans Deployment Beginner Deployment Plan
How to Perform a Remote Deploy Deployment Intermediate Deployment Plan
How to solve the UnsupportedClassVersionError error Deployment Intermediate Deployment
WebRatio Variables Deployment Beginner WebRatio












Personal tools