maven 发布war包到 tomcat

Tomcat 版本:7.0.54

1. pom.xml 配置

<!-- war包名称 -->
<finalName>${project.artifactId}</finalName>
....
<plugin>
    <groupId>org.apache.tomcat.maven</groupId>
    <artifactId>tomcat7-maven-plugin</artifactId>
    <version>2.2</version>
    <configuration>
        <url>http://localhost:8080/manager/text</url>
        <username>tomcat</username>
        <password>123456</password>
        <!-- war包名称 -->
        <path>/${project.artifactId}</path>
    </configuration>
</plugin>

 

2. ${CATALINA_HOME}/conf/tomcat-users.xml

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

 

3. 命令:mvn tomcat7:redeploy


你可能感兴趣的:(maven 发布war包到 tomcat)