Portlet Factory, Version 6.1.2


 

Predeployment script example

An ant script can call a utility to add a servlet definition to the project web.xml file.

The following ant script example calls the addaServlet utility for adding a servlet definition (SchedulerInit) to the project web.xml file.

 - <project name="addSchedulerServlet" basedir="." default="execute">
    - <target name="execute">
          <antcall target="addSchedulerServlet" />
      </target>
    - <target name="addSchedulerServlet">
          - <ant antfile="${tools.location}/publish/publish_utils.xml" target="addaServlet">
              <property name="comment" value="Scheduler servlet for Alerting features." />
              <property name="servletName" value="SchedulerInit" />
              <property name="servletClass" value="com.bowstreet.util.scheduler.init.SchedulerInitializationServlet"/>
              <property name="loadOnStartup" value="3">
              <property name="urlPattern" value="/SchedulerInit" />
              <property name="webXmlFile" value="${project.location}/WEB-INF/web.xml: />
            </ant>
      </target>
   </project>

If you put this script in the project WEB-INF\bin\predeploy directory, the default target (in this case, "execute") is called before the application is deployed. You can write your own ant scripts, for example, to create your own custom tasks, and put them in the predeploy and postdeploy directories, and they will be executed automatically.

Parent topic: Extending a deployment


Library | Support |