Chapter 8: Web Application Administration
The
tag has attributes for the name of the project and the default target. The default target in this case is called dist (i.e., create the distributable jar file). Running Ant with no options will invoke the tasks associated with this default target. The basedir attribute is the base directory for all path calculations in the Ant build script. This is set to . (i.e., the current directory), so all the paths for the build process are assumed to be relative to the directory from which Ant is run. The properties for the build are defined next, such as the location of the target directory where the WAR file is generated. Typical Web applications have Java code in them (Java beans, servlets), and thus the build file would have a property pointing to the source directory. Having these properties is not mandatory, but merely a convenience to avoid putting the full path names in multiple places in the build script, and thus introducing potential sources of errors. The following properties specify the access URL and username/password for the manager application. This password can be passed via the command line, or included from a property file.
The task definitions for the manager application now need to be specified. Ant allows for custom tasks that extend its functionality. Tomcat implements the custom tasks shown in the following example for executing the managerapplication commands. For example, org.apache.catalina.ant.DeployTask executes the deploycommand against the manager application: … Instead of adding one line for each task, a more convenient mechanism is to list all tasks in a property file, as shown here: deploy=org.apache.catalina.ant.DeployTask list=org.apache.catalina.ant.ListTask status=org.apache.catalina.ant.JKStatusUpdateTask jmxget=org.apache.catalina.ant.JMXGetTask jmxquery=org.apache.catalina.ant.JMXQueryTask jmxset=org.apache.catalina.ant.JMXSetTask reload=org.apache.catalina.ant.ReloadTask remove=org.apache.catalina.ant.RemoveTask resources=org.apache.catalina.ant.ResourcesTask roles=org.apache.catalina.ant.RolesTask serverinfo=org.apache.catalina.ant.ServerinfoTask sessions=org.apache.catalina.ant.SessionsTask start=org.apache.catalina.ant.StartTask stop=org.apache.catalina.ant.StopTask undeploy=org.apache.catalina.ant.UndeployTask
If you looking for unlimited one inclusive web hosting plan please check unlimited web hosting website.
This entry was posted
on Thursday, April 30th, 2009 at 2:28 am and is filed under tomcat.
You can follow any responses to this entry through the RSS 2.0 feed.
Responses are currently closed, but you can trackback from your own site.