美文网首页
4.tomcat+maven的热部署配置

4.tomcat+maven的热部署配置

作者: 广西年轻人 | 来源:发表于2018-04-24 21:49 被阅读14次

    tomcat7:

    1.编辑tomcat下的conf/tomcat-users.xml

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

    2.修改maven的配置

    编辑maven目录下conf/settings.xml,在servers节点下添加:

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

    pom中热部署插件的配置:

    <!-- 配置Tomcat插件 -->
                <plugin>
                    <groupId>org.apache.tomcat.maven</groupId>
                    <artifactId>tomcat7-maven-plugin</artifactId>
                    <version>2.2</version>
                    <configuration>
                        <path>/${project.build.finalName}</path>
                        <port>8080</port>
                        <uriEncoding>UTF-8</uriEncoding>
                        <server>tomcat7</server>
                        <username>tomcat</username>
                        <password>tomcat</password>
                        <url>http://0.0.0.0:8080/manager/text</url>
                    </configuration>
                </plugin>
    

    相关文章

      网友评论

          本文标题:4.tomcat+maven的热部署配置

          本文链接:https://www.haomeiwen.com/subject/qdeslftx.html