tomcat的任务需要管理者的用户名和密码

即在tomcat-users.xml加入
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)  <user username="admin" password="admin" roles="admin,manager"/>
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)

一行,表明创建一个admin用户,它的角色是admin,manager

以下tomcat中的属性定性:(tomcatTasks.properties)
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)deploy=org.apache.catalina.ant.DeployTask
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)undeploy=org.apache.catalina.ant.UndeployTask
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)remove=org.apache.catalina.ant.RemoveTask
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)reload=org.apache.catalina.ant.ReloadTask
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)start=org.apache.catalina.ant.StartTask
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)stop=org.apache.catalina.ant.StopTask
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)list=org.apache.catalina.ant.ListTask

引入tomcat的任务属性文件:
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)<taskdef file="tomcatTasks.properties">
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)        
<classpath>
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)            
<pathelement path="${tomcat.home}/server/lib/catalina-ant.jar"/>
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)        
</classpath>
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)    
</taskdef>


引用tomcatTasks.properties中install,即调用 org.apache.catalina.ant.deploy(deploy布署)
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)<target name="install" description="Install application in Tomcat"
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)        depends
="war">
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)        
<deploy url="${tomcat.manager.url}"
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)            username
="${tomcat.manager.username}"
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)            password
="${tomcat.manager.password}"
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)            path
="/${webapp.name}"
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)            war
="file:${dist.dir}/${webapp.name}.war"/>
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)    
</target>

移除tomcat中的应用程序,即调用 org.apache.catalina.ant.undeploy
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)<target name="remove" description="Remove application from Tomcat">
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)        
<undeploy url="${tomcat.manager.url}"
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)            username
="${tomcat.manager.username}"
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)            password
="${tomcat.manager.password}"
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)            path
="/${webapp.name}"/>
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)    
</target>


reload,start,stop和list任务也相似
 

ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)  <target name="reload" description="Reload application in Tomcat">
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)        
<reload url="${tomcat.manager.url}"
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)            username
="${tomcat.manager.username}"
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)            password
="${tomcat.manager.password}"
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)            path
="/${webapp.name}"/>
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)    
</target>
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)    
<target name="start" description="Start Tomcat application">
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)        
<start url="${tomcat.manager.url}"
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)            username
="${tomcat.manager.username}"
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)            password
="${tomcat.manager.password}"
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)            path
="/${webapp.name}"/>
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)    
</target>
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)    
<target name="stop" description="Stop Tomcat application">
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)        
<stop url="${tomcat.manager.url}"
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)            username
="${tomcat.manager.username}"
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)            password
="${tomcat.manager.password}"
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)            path
="/${webapp.name}"/>
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)    
</target>
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)    
<target name="list" description="List Tomcat applications">
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)        
<list url="${tomcat.manager.url}"
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)            username
="${tomcat.manager.username}"
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)            password
="${tomcat.manager.password}"/>
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)    
</target>
ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-04
猜你喜欢
  • 2022-01-18
  • 2021-11-15
  • 2021-08-14
  • 2021-12-24
  • 2021-05-14
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案