Getting Started with the Deployment Plans
From Wiki
|
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.
- 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:
Ant: executes a custom Ant build file stored in the Web project workspace folder
Clear Deployment Folder: wipes out the deployment folder
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
Delete Hibernate Java Sources: removes the *.java Hibernate source files stored in the deployment folder under WEB-INF/classes
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.
JAR Descriptor Folder: packages the contents of the WEB-INF/descr folder with a single JAR file and stores it into WEB-INF/lib
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.
<?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:
|



