maven部署tomcat7
2015-07-24 00:00
393 查看
摘要: 如何使用maven来部署项目到tomcat7并启用debug调试
1、修改项目pom.xml
在project节点下,添加tomcat-maven-plugin插件信息,配置好tomcat管理帐号和密码
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<server>tomcat7</server>
<port>8082</port>
<path>/Openoa</path>
<url>http://localhost:8082/manager/text</url>
<username>tomcat</username>
<password>123456</password>
<uriEncoding>UTF-8</uriEncoding>
</configuration>
<executions>
<execution>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
2、修改(tomcat)server下tomcat-users.xml文件 给tomcat 添加管理员
<role rolename="manager-script"/>
<role rolename="manager-gui"/>
<user username="tomcat" password="123456" roles="manager-script , manager-gui"/>
3、启动tomcat,发布项目
新建maven build 在Goals下输入:tomcat7:deploy -Dmaven.test.skip=true
大意为在tomcat下部署,部署过程中忽略测试路径
Base directory:为项目路径,使用debug或run运行
当控制台出现如下字样表示部署成功
4、关闭tomcat、使用maven命令运行tomcat
新建maven build 在Goals下输入:tomcat7:run -Dmaven.surefire.debug
大意为 运行tomcat7 启用调试
配置如图
配置好后使用debug运行,这样就可在tomcat中发布并调试web项目了
运行后 如出现如下等字样又无出现运行时异常,表示部署成功了
1、修改项目pom.xml
在project节点下,添加tomcat-maven-plugin插件信息,配置好tomcat管理帐号和密码
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<server>tomcat7</server>
<port>8082</port>
<path>/Openoa</path>
<url>http://localhost:8082/manager/text</url>
<username>tomcat</username>
<password>123456</password>
<uriEncoding>UTF-8</uriEncoding>
</configuration>
<executions>
<execution>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
2、修改(tomcat)server下tomcat-users.xml文件 给tomcat 添加管理员
<role rolename="manager-script"/>
<role rolename="manager-gui"/>
<user username="tomcat" password="123456" roles="manager-script , manager-gui"/>
3、启动tomcat,发布项目
新建maven build 在Goals下输入:tomcat7:deploy -Dmaven.test.skip=true
大意为在tomcat下部署,部署过程中忽略测试路径
Base directory:为项目路径,使用debug或run运行
当控制台出现如下字样表示部署成功
4、关闭tomcat、使用maven命令运行tomcat
新建maven build 在Goals下输入:tomcat7:run -Dmaven.surefire.debug
大意为 运行tomcat7 启用调试
配置如图
配置好后使用debug运行,这样就可在tomcat中发布并调试web项目了
运行后 如出现如下等字样又无出现运行时异常,表示部署成功了
相关文章推荐
- JQuery1——基础($对象,选择器,对象转换)
- java对世界各个时区(TimeZone)的通用转换处理方法(转载)
- java-注解annotation
- java-模拟tomcat服务器
- java-用HttpURLConnection发送Http请求.
- java-WEB中的监听器Lisener
- Android IPC进程间通讯机制
- Android之获取手机上的图片和视频缩略图thumbnails
- Android Native 绘图方法
- Android java 与 javascript互访(相互调用)的方法例子
- 介绍一款信息管理系统的开源框架---jeecg
- 聚类算法之kmeans算法java版本
- java实现 PageRank算法
- PropertyChangeListener简单理解
- JavaScript演示排序算法
- 插入排序
- 冒泡排序