首页 > 其他 > 详细

maven 部署 tomcat

时间:2014-11-27 16:32:55      阅读:241      评论:0      收藏:0      [点我收藏+]
  1. 确保maven 在eclipse配置好了

  2. poix.xml

<build>
  <finalName>zs</finalName>
  <plugins>
   <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>tomcat-maven-plugin</artifactId>
    <version>1.1</version>
    <configuration>
     <path>/test</path>
     <url>http://localhost:8080/manager/text</url>
     <server>tomcat</server>
     <username>admin</username>
     <password>admin</password>
     <path>/zs</path>
     <update>true</update>
    </configuration>
   </plugin>
<!--  <plugin> -->
<!--   <groupId>org.apache.maven.plugins</groupId> -->
<!--   <artifactId>maven-surfire-plugin</artifactId> -->
<!--   <version>2.12.4</version> -->
<!--   <configuration> -->
<!--    <testFailtureIgnore>true</testFailtureIgnore> -->
<!--   </configuration> -->
<!--  </plugin> -->
  </plugins>
 </build>

3.tomcat conf/tomcat-users.xml添加

<role rolename="manager-gui"/>
  <role rolename="manager-script"/>
  <user username="admin" password="admin" roles="manager-gui, manager-script"/>

4.maven settings.xml(可以是自定义settings.xml)

<server>  
        <id>tomcat</id>  
        <username>admin</username>  
        <password>admin</password>  
    </server>

然后eclipse 中运行(前提是要tomcat先运行)

package tomat:redeploy

maven 部署 tomcat

原文:http://my.oschina.net/u/1388758/blog/349394

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!