The login
registered
Write an article
Home page
Download the APP

Jenkins + Maven+ SVN +Tomcat automatic deployment

A little sadness

Jenkins + Maven+ SVN +Tomcat automatic deployment

I heard that Jenkins has been playing for a long time. I found it very convenient to develop and submit the code to SVN. When Jenkins detects it, it will be automatically packaged and deployed to the remote server. The convenience of single-server deployment is limited (because it is poor), but it is ok. Be prepared to consider limiting colleagues’ access to the server and letting them deploy through it.

Jenkins is a visual Web tool widely used for continuous construction, which is the “automated” compilation, packaging and distribution deployment of various projects. The previous compilation, packaging, uploading and deployment into Tomcat are handed over to Jenkins. Jenkins uses the given code address, The code is pulled to the Jenkins host, compiled, packaged, and published to a Web container. Jenkins can support multiple languages (such as Java, c#, PHP, etc.), also compatible with ant, maven, gradle and other third-party building tools, while seamlessly integrating with git and SVN, and also supports direct integration with github.

Here is the deployment process, written quite simple and messy, but not stupid should be able to understand.

https://jenkins.io/index.html website to download Jenkins War file

• Drop into Tomcat. Visit http://localhost: port/Jenkins

• Enter the initial password (in which file is prompted)

• Install the plug-in, the first one can, there may be failure, no matter, network problems. (To be installed later)


• Enter the administrator information


• Save


• Click on System-Administration-Global Tool Configuration to configure the JDK and Maven


• Click on the credentials to add SVN accounts. In fact, I think git is similar (I haven’t used it yet).

• Click System Administration > Plugin Management to install the Deploy to Container Plugin


I don’t have the Maven plugin installed. There is an option to create a New Maven project, but I don’t need it. I have a few pits to talk about,

• The SVN account must be added in front of it, but cannot be added on this page. (My dont know Why)

• The SVN directory must be correct, pointing to the upper level of the POM directory (project directory)

• Build trigger this is a single expression, I mean scan every 5 minutes (scan the SVN code for changes)

• Many options for post-build operations, email notifications.. You can add anything.

Here are a few pits to mention:

1) The tomcat path should be correct, and the port should not be wrong. I have enabled Nignx mapping. Before, I used port 80 and kept reporting errors, but later I changed it back to the real port.

2) Add an administrator to tomcat-users. XML in the conf directory of Tomcat. /manager/list 404 = /manager/list 404 = /manager/list 404 = /manager/list 404 Just unzip the native tomcat. zip file.)






After saving, you can click On Console Output to see the Output. After success, you can see that the server has been able to access the project. Other details are not much, simple, or Chinese interface. Attached is a screenshot:


Recommended readingMore highlights

  • [original]Linux Environment -Jenkins Hands-on – Distributed Build – Automated Continuous Integration – Automated Deployment – GitLab… Without further ado, start implementing… Some basic knowledge needs to be practiced, self-supplement and improvement. The principle is described in the next section. The l… Znb_tianxuan Read 1,512 comments 2 upvotes 9
  • Spring Cloud provides developers with tools to quickly build common patterns in distributed systems (e.g., configuration management, service discovery, circuit breakers, intelligence… Kakaro 2017 Read 70,855 comments 12 likes 116
  • Jenkins deployment automation platform + tomcat restart (SVN) resources address: http://blog.csdn.net/zjs40/article/details/5181832… Read 1,665 comments 0 likes 0
  • Spring boot reference guide to Spring the boot reference guide translated from: https://www.gitbook.com/book/qbgb… MAO Yupeng Read 34,955 Comments 5 likes 337
  • Maven + Jenkins +git (SVN) +tomcat automatic compilation and deployment (continuous integration) Purpose: In the development, it is necessary to frequently deploy the test server, and in the collaborative development of many people often encounter the problem is that others update his code, and you… Raye Read 739 Comments 0 likes 23