Jenkins, previously named as Hudson, is a continuous integration tool just like CruiseControl. It has been almost 4 years since i started learning Maven which made me fall in love about best practice. Deployment and testing automation is really fun and finally i got a chance to play it again.
In this article, i would show you how to setup a simple Ant build project in Jenkins. Before we start, please refer to the simple Java project example in the post below.
1. Download and install Jenkins.
2. After the installation, you should be able to visit the Jenkins home page by visiting http://localhost:8080/.
3. Configure Jenkins by clicking Manage Jenkins on the left sidebar and the go to the Configure System page.
4. Setup at least one JDK installation and one Ant installation as well.
5. Now we are ready to move on. On the left menu, add a new job and call it com-eureka. As we are working on a simple Ant build project, select Build a free-style software project.
6. After the job is created, you will be on the job configuration page.
7. Add a new Build step and select Invoke Ant.
8. Select the Ant version which we have already configured it on the Configure System page. We could leave the target blank so it will run the default main target defined in the build.xml.
9. Go the the job directory which is C:\Program Files (x86)\Jenkins\jobs\com-eureka in this example. Create a folder name called workspace.
10. Now copy all the source code to this workspace folder.
11. Now go to the com-eureka job index page and click Build Now.
12. After the build, click the build details and you can also refer to the console output and check if there is any errors on the build script.