The common development mode in daily development projects is to use the code base to store our projects such as: SVN, Git, CVS, etc., using Maven for project management and need to manually package and deploy to the server when testing and publishing the project , so that for repeated operations of project deployment, if the deployment fails, version recovery needs to be manually changed and maintained. Is there such a tool that can help us automatically manage and deploy projects? The answer is yes and there are many examples on the Internet. Below I have given a primary entry example to explain to you.
Need to prepare software jenkins, Maven, Tomcat7.x
Jenkins installation and deployment can go directly to the official download war and put it into Tomcat to start the deployment. For specific installation steps, please refer to the following post: Jenkins installation. Jenkins official website : http://Jenkins-ci.org/
Maven installation can go to the official website to download the latest Maven and then configure the new M2_HOME value in the environment variable F:\Maven\apache-maven-3.1.1 Add ;%M2_HOME%\bin to Path
Tomcat installation official website Download Tomcat7.x and extract it to the system directory Configure the unzip directory in the environment variable Create a new environment variable CATALINA_BASE value F:\apache-tomcat-7.0.53
CATALINA_HOME 值 F:\apache-tomcat-7.0.53
Add %CATALINA_HOME%\lib;%CATALINA_HOME%\bin to path
After starting tomcat, enter the jenkins access address: http://localhost:8080/jenkins/
Let's start the basic Maven code repository build:
Click New
tomcat configuration file config/tomcat-users.xml
Add the following to the <tomcat-users> tag
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<user username="tomcat" password="tomcat" roles="manager-gui,manager-script,manager-jmx,manager-status"/>
</tomcat-users>
Click Save to complete the basic configuration
Then click Build Now to start building the project and deploying to tomcat. If an error occurs, please go to the workspace to find Buidl History to find the deployment error log record.
Refer to the blog: http://blog.csdn.net/wangmuming/article/details/22925127
tomcat content overflow: http://chenkaiadd.iteye.com/blog/1536991
Jenkins series of articles: http://blog.csdn.net/wangmuming/article/category/2167947
ok, I will write this blog editor based on the git repository for the time being.