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