zoukankan      html  css  js  c++  java
  • Maven

    This article will explain on how to deploy a war fine in to Tomcat 7 through maven build.

    Note : I have tested same settings for Tomcat 8 as well. So below settings can be apply for both versions.

    Configure tomcat7-maven-plugin in pom.xml

        <!-- Tomcat plugin -->  
                <plugin>  
                     <groupId>org.apache.tomcat.maven</groupId>  
                     <artifactId>tomcat7-maven-plugin</artifactId>  
                     <version>2.2</version>  
                     <configuration>  
                     <!-- finalName:defaults to ${artifactId}-${version} -->
                      <path>/beepay</path>  
                      <update>true</update>  
                      <url>http://localhost:8080/manager/text</url>
                      <server>Tomcat</server>  
                      <username>tomcat</username>  
                      <password>tomcatuser</password>  
                     </configuration>  
                </plugin> 

    Configure user rights in the tomcat-user.xml which is in the tomcat conf file.

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

    Adding server to Maven settings.xml file: Next step is to add a server in maven settings.xml file, as shown below.

    <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                              http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <servers>
          <server>
            <id>Tomcat</id>
            <username>tomcat</username>
            <password>tomcatuser</password>
          </server>
    </servers>
    </settings>

    overwrite the tomcat-users.xml to eclipse server folder :Project Explorer > 'Server's > Tomcat v7.0 Server at localhost-config > tomcat-users.xml

    change  default deployment  path to:

    add a mvn goal:

     

  • 相关阅读:
    用js onselectstart事件鼠标禁止选中文字
    模仿苹果菜单的导航
    返回页面顶部
    商品展示的放大镜效果
    键盘控制Div的移动
    Div跟随鼠标移动
    瀑布流的布局(功能还没有完善)
    类似时光轴的效果
    ie6-ie8中不支持opacity透明度的解决方法
    :active pseudo-class doesn't work in mobile safari
  • 原文地址:https://www.cnblogs.com/sos-blue/p/4803992.html
Copyright © 2011-2022 走看看