You can write ant scripts to extend a project's functionality or perform publishing operations that you would otherwise have to do manually.
Scripts can be made to execute automatically before you publish a project or after you publish.
For example, you might write a script to execute before the Publish Application function starts that adds a servlet to the project's web.xml file to configure a feature set, setting properties, or updating servlet definitions and mappings. A script that you write to execute after publishing might execute XMLAccess to create users, groups, pages, or position applications on a page.
All configuration and project properties are available for use in your script. Project properties reside in the project\\.bowstreet
file. By default, configuration properties reside in workspace\\.metadata\\.plugins\\com.bowstreet.designer.webapp\\deploymentconfigs
, where workspace
is the directory in which your projects reside. If you have specified a different location in Preferences
, the properties reside in the location you specified. Use the property = value
syntax in your scripts as illustrated in the example below.
The order in which scripts execute is not guaranteed. Therefore, you should make sure that feature sets are configured without dependencies on each other.
You may need to organize your scripts to allow for conditional processing depending on configuration type. For example, if you are publishing to Tomcat, you need to take into account that Tomcat does not have xml access.
Parent topic: Automation and scripting of publishing and exporting: wpf7