Reputation: 49
I need some help with the Java code for my web application. I need to create a WAR file of my java code uploaded on stash using jenkins and deploy it to nexus. Finally from nexus i need to deploy the WAR file to my tomcat instance to run the application.
I am not sure how jenkins is going to create a WAR file. Can someone please advise.
Upvotes: 0
Views: 11388
Reputation: 16505
You don't need Jenkins to create the war file. A war file could be created with:
You could install ant or maven plugin in order to execute necessary commands.
Also you can use single shell execution ( in build section on Jenkins project) and execute your ant or maven commands.
Again, Jenkins is not a magician. Jenkins needs another tools to use nexus.
You could install the nexus plugin for Jenkins or just execute command line sentences directly to nexus.
Tomcat has two ways to deploy any war file:
Again, Jenkins could use any of the previous approaches. Just install the tomcat plugin or execute command line sentences.
Create the war, upload it to nexus and deploy it to tomcat using shell without Jenkins. If you can do this without any error, put these steps in Jenkins with:
If you start with Jenkins configurations you will get confuse errors and you could lost time.
Upvotes: 1
Reputation: 4767
@jrichardsz answer provides substantial good direction, but your response suggests you should reconsider your question, re: strategic tool" and "implement CI/CD".
Jenkins is CI/CD tool. It orchestrates tasks, including building (war using ant/maven) and deploying (nexus and tomcat env), as well as testing and all sorts of other tasks. You needs to understand the individual steps you need to execute, then understand how to orchestrate them in Jenikns. Review https://jenkins.io/doc/ for the second part.
ps: recommend using maven over ant for Java and use tomcat manager or jenkins plugins to deploy war rather than copy/paste.
Upvotes: 0