You can build this project in Jenkins using Ant or Maven. Let us assume that you are using Maven
You can follow these steps -
1. Create a new job by clicking new item in Jenkins.
2. Select Maven project in the option. If Maven project option is not available then you need to install maven plugin and then follow these steps.
3. Give a name to the job and click ok.
4. Now go to manage jenkins and then configure system. Here make sure you have JDK installed and correct JAVA_HOME. Same things for Maven.
5. Now go to the build section of the new job. In the root POM enter the path to your pom.xml file. In the goals and options enter clean install or clean test or whatever maven commands that you wish to execute. Then click on apply.
6. Now go to your project page and click on build now option. now maven will build the project and testng will run the test cases. Once the build process is done, you can click on the project on the jenkins dashboard. You can now see the result of your project.You can also the output in the console output option.