心情烦躁的图片和说说:TCD of tomcat
来源:百度文库 编辑:偶看新闻 时间:2024/05/03 00:42:19
Apache offers a tool called TCD (Tomcat Client Deployer) which can be used to deploy web application REMOTELY.
The tool relies on Tomcat Manager application.
TCD can be easily integrated into ANT build script. Along with TCD distribution there is a template build.xml. I extract some common information and add some information useful to myself.
Properties used by this build file are from two external sources. One is the global properties file, which contains properties that suitable to all my web applications. Properties defined in this file should be identical to all applications. The other one is a project-specific properties file. This one should be placed into the root folder of the project.
The global properties file is,
tomcat.manager.url=http://192.168.140.100:8080/manager
tomcat.manager.username=admin
tomcat.manager.password=admin
tomcat.deployer.jars.dir=C:/Java/apache-tomcat-5.5.20-deployer/lib
The project-specific properties file,
# The location containing your source files
src=src
# The location containing the exploded web application
webcontent=WebContent
# The context path of the web application
contextpath=/myWebapp
The complete ANT build file is:
webXmlFragment="${webapp.path}/WEB-INF/generated_web.xml"
addWebXmlMappings="true"
outputDir="${webapp.path}/WEB-INF/classes" />
debug="${compile.debug}"
deprecation="${compile.deprecation}"
failonerror="false"
srcdir="${src.dir}"
encoding="UTF-8"
excludes="**/*.smap">
In above build file,
uriroot="${webapp.path}" webXmlFragment="${webapp.path}/WEB-INF/generated_web.xml" addWebXmlMappings="true" outputDir="${webapp.path}/WEB-INF/classes" /> webXmlFragment attribute specifies the name of the web.xml fragment generated by jasper2 during the JSP compilation. Reload won‘t transfer war file to server. It just tells server to reload the specified web application from server local file system. So it is more useful to be used with local Tomcat and an exploded web application.