How to deploy war to tomcat using jenkins pipeline?

后端 未结 3 940
北荒
北荒 2021-01-23 17:17

I want to deploy war file using pipeline. What is the correct way to do it . Is there any way to use Deploy to container in pipeline code. The problem with calling catalina.sh o

3条回答
  •  再見小時候
    2021-01-23 18:11

    In tomcat, configuration with jenkins and tomcat:

    • Install and download the jenkins on your server and start the server go to jenkins portal after that create the project using 'New Item' and select the pom.xml and create the maven project.
    • Now go to your project and click on Configure and select the "Restrict where this project can be run" and add master in your Level Expression.
    • select the "Source Code Management" clisck on git and configure your git repository and credential and branch name.
    • Select the "Build" add Root pom : pom.xml and Goals and options : clean install -DskipTests
    • select the "Post-build Actions" and select the "Deploy war/ear to a container"
    • WAR/EAR files : target/test.war
    • Context path : test
    • Containers select tomcat and add Credentials
    • Tomcat URL : example : http://localhost:8080/

    Update the 'apache-tomcat-8.5.5\webapps\manager\META-INF\context.xlm file. uncomment the Value tag. and restart server

    context.xml file

    Before : 
    
    
    
    
    
    After change :
    
    
    
    
    for auto deployment: go to 'apache-tomcat-8.5.5\conf\context.xml' and add antiResourceLocking="true" in 'Context' tag
    

提交回复
热议问题