maven tomcat7 自动部署
来源:互联网 发布:蝙蝠侠 知乎 编辑:程序博客网 时间:2024/05/17 00:14
假设项目名字为myApp
step1:
pom.xml 中在build里面加入
<plugin><groupId>org.apache.tomcat.maven</groupId><artifactId>tomcat7-maven-plugin</artifactId><version>2.2</version><configuration><url>http://localhost:8080/manager/text</url><server>TomcatServer</server><path>/myApp</path></configuration></plugin>
step2:
进入tomcat安装目录下找到 webapps\manager\WEB-INF 的web.xml 将下列东西注释掉,(取消访问需要的权限)
<!-- NOTE: None of these roles are present in the default users file <security-constraint> <web-resource-collection> <web-resource-name>HTML Manager interface (for humans)</web-resource-name> <url-pattern>/html/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>manager-gui</role-name> </auth-constraint> </security-constraint> <security-constraint> <web-resource-collection> <web-resource-name>Text Manager interface (for scripts)</web-resource-name> <url-pattern>/text/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>manager-script</role-name> </auth-constraint> </security-constraint> <security-constraint> <web-resource-collection> <web-resource-name>JMX Proxy interface</web-resource-name> <url-pattern>/jmxproxy/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>manager-jmx</role-name> </auth-constraint> </security-constraint> <security-constraint> <web-resource-collection> <web-resource-name>Status interface</web-resource-name> <url-pattern>/status/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>manager-gui</role-name> <role-name>manager-script</role-name> <role-name>manager-jmx</role-name> <role-name>manager-status</role-name> </auth-constraint> </security-constraint>--> <!-- Define the Login Configuration for this Application <login-config> <auth-method>BASIC</auth-method> <realm-name>Tomcat Manager Application</realm-name> </login-config>--> <!-- Security roles referenced by this web application <security-role> <description> The role that is required to access the HTML Manager pages </description> <role-name>manager-gui</role-name> </security-role> <security-role> <description> The role that is required to access the text Manager pages </description> <role-name>manager-script</role-name> </security-role> <security-role> <description> The role that is required to access the HTML JMX Proxy </description> <role-name>manager-jmx</role-name> </security-role> <security-role> <description> The role that is required to access to the Manager Status pages </description> <role-name>manager-status</role-name> </security-role>-->
step3: 写一个批处理 autoDeploy.bat
set myProject=.......\workspace\myAppset myTomcat=.....\apache-tomcat-7.0.70set myAppName=myAppcd %myProject%call mvn cleancall mvn installif not exist %myTomcat%\webapps\%myAppName% (call mvn tomcat7:deploy) else (call mvn tomcat7:redeploy)pause
再将autoDeploy.bat 所在的目录设置到 PATH 里面,这样就可以打开cmd,直接输入autoDeploy,完成tomcat的自动部署了
可以在 localhost:8080/manager 里面看到增加了一个项目,直接点击就可以打开网页啦
0 0
- Maven Tomcat7自动部署
- Maven Tomcat7自动部署
- maven自动部署tomcat7
- maven tomcat7 自动部署
- Maven Tomcat7自动部署
- Maven Tomcat7自动部署
- Maven Tomcat7自动部署
- maven 自动部署到 tomcat7
- maven 自动部署到 tomcat7
- maven 自动部署到 tomcat7
- maven 自动部署到 tomcat7
- maven 自动部署到 tomcat7
- Maven自动部署war到Tomcat7
- maven tomcat8 自动部署(支持tomcat7)
- Maven学习总结——Maven Tomcat7自动部署
- maven下配置程序自动部署到tomcat7
- maven部署应用tomcat7
- maven cargo tomcat7 远程部署
- code Review(写更好的代码)
- Android开发中常用的开发工具
- php实现第三方登录,百度第三方登录
- COGS 260. [NOI2002] 银河英雄传说 解题报告
- Spring如何加载XSD文件以及抱错
- maven tomcat7 自动部署
- stc12c5a单片机双串口驱动
- Java中DecimalFormat的用法!
- Makefile
- Windows下PHP版本选择
- "==” 和 .equals 的区别
- CentOS下编译比特币(Bitcoin)客户端遇到possibly undefined macro: PKG_CONFIG_LIBDIR问题的解决方法
- 使用ToolBar出现的一个问题
- 从和式积分到定积分