This article is a brief introduction of how to use maven to deploy your website into tomcat7 [Ubuntu].
1. Install Tomcat 7 & Maven
It is pretty easy to do, so I don’t write anything related to their installation here.
2. Modify /etc/tomcat7/tomcat-users.xml
1 2 3 4 5
<!-- Create new roles and new users --> <rolerolename="manager-script"/> <rolerolename="manager"/> <rolerolename="admin"/> <userusername="username"password="password"roles="manager,admin,manager-script"/>
3. Add a server in Maven: /etc/maven/settings.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<servers> <!-- server | Specifies the authentication information to use when connecting to a particular server, identified by | a unique name within the system (referred to by the 'id' attribute below). | | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are | used together. | --> <server> <id>TomcatServer</id> <username>username</username> <password>password</password> </server> </servers>