The local idea wrote a simple Maven project that showed only one page. Then push the project git to the server.
After the server git pull fetch (clone is needed for the first time), the following is the way to package the project after compiling:
Premise (server environment to be set up (Java, MAVEN, Tomcat, git details see previous blog))
1. Cloning the project to the server
/srv/www/wizzie/
2. Project packing and compiling
MVN Clean Package Install
Package path to maven warehouse path/root/.m2/respobility/..../version folder/. War file
3. Move the war packet to the configured Tomcat project release path
MV War package current path target path
When you are finished, view the catalog file:
Three path locations for general Tomcat:
Typically under the/usr/share/tomcat8/webapps/path
If you want to modify the project path, modify it in/usr/tomcat8/server.xml, open server.xml and add it to the final host tag.
<context path= "/srv/www/" (custom project path) docbase= "photo" debug= "0" reloadable= "true"/>
4. Restart Tomcat after the Tomcat/bin directory (run two commands directly in the directory)
5. When you close Tomcat, you will encounter many problems:
At this point, you can view the log for detailed errors to resolve the issue:
Cat log log: View detailed errors after
6, after the browser input:
http://www.wizzie.top:8080/sunblog-1.0-snapshot/
7, the discovery of such input domain name into the site is very troublesome
You need to modify the port at this time, modify the port to 80 in the Tomcat profile Server.xml to map directly to the extranet IP without adding 8080 ports
8. Viewing effects
Linux Server Tomcat launches MAVEN project