The deployment instructions in the tomcat7-maven-plugin plugin are added

There are many instructions for deploying in the tomcat7-maven-plugin plugin on the Internet, but they are not very specific. After repeated attempts, they are sorted as follows.

1)

deploy is based on tomcat's manager function, first configure manager-related roles

Configure apache-tomcat-7.0.54\conf\tomcat-users.xml in the file

<role rolename="manager-script"/><!--Script release-->

<role rolename="manager-gui"/><!--Manual release-->

<user username="deployer" password="s3cret" roles="manager-script"/>

<user username="admin" password="admin" roles="manager-gui"/>

2) Plugin tomcat7-maven-plugin property configuration

<configuration>

<path>/static</path>//Define the access context of the application

<update>true</update>

<uriEncoding>UTF-8</uriEncoding>

<finalName>static</finalName>

<url>http://localhost/manager/text</url>

<!-- http://localhost/manager/html is based on page operation, text is based on script, many introductions are written here as html -->

<username>deployer</username> <!-- username, password to use when script is published -->

                                                         <password>s3cret</password> 

                                                         <server>tomcat</server>

<!--If you don't want to expose the username and password above, you can configure the user password to maven settings.xml -->

</configuration>

3)。。。。conf\settings.xml 

    <server>  

       <id>tomcat</id>  

        <username>deployer</username>

        <password>s3cret</password>

    </server> 

4) Start tomcat and execute tomcat7:deploy to publish to tomcat

http://localhost/manager/html Use the user corresponding to the manager-gui role to enter, you can see the new deploy application

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326329137&siteId=291194637