jenkins automatically deploys tomcat projects

One-click deployment of tomcat with jenkins

1. First download and install the Deploy to container plugin plugin

2. Add administrator user to tomcat

    Modify tomcat-users.xml

Join in the middle of <tomcat-users> </tomcat-users>

<user username="admin" password="admin" roles="admin,manager,role1,Tomcat"/>

3. Add a build task

- Specify the jdk version, here, we use jdk1.6

- During the build, add an Execute Windows batch command. Copy the jar package in the fixed location to the workspace of jenkins.

- add post-build actions,

       a. war/ear files: specify the name of the war package

       b. container select tomcat6.x (this depends on the specific project, you must choose the tomcat used in your own project, there are differences between different versions of tomcat)

       c. Enter the tomcat username, password and url address.

save. Immediate build can be completed every time the war package is placed in a fixed location, and then one-click deployment is achieved.

 

 

 

Possible problems:

tomcat reports an error:

严重:[XXXX\tomcat\webapps\XXX\WEB-INF]could not be completely deleted. The presence of the remaining files may cause problems.

 

 

The reason is

The folder is locked, refer to http://www.myexception.cn/open-source/1177067.html

Solution:

In conf/context.xml put

<Context>

change to

<Context antiJARLocking="true" antiResourceLocking="true">

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326561348&siteId=291194637