For Tomcat 7, we need some different configuration with Tomcat 6.
Difference 1: in hudson, we need to set the container as Tomcat 7.x, easy!.
Difference 2: in tomcat, we need a different tomcat-users.xml
Previously, we use the Tomcat 6's tomcat-users.xml for Tomcat 7, as shown below:
<role rolename="manager"/>
<role rolename="admin"/>
<user username="administrator" password="administrator" roles="admin,manager"/>
With this configuration on Tomcat 7, when our hudson deploys war, we would encounter this error:
The username you provided is not allowed to use the text-based Tomcat Manager (error 403)
Therefore, we know what's the problem, and the following configuration works:
<role rolename="manager"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="admin"/>
<user username="administrator" password="administrator" roles="admin,manager,manager-script,manager-gui"/>