Create a Jenkins job for a Maven Selenium tests
Now a days CI (Continuous Integration) is a best practice, that is being followed in most of the projects. As a part of CI, executing the related tests after a deployment is crucial, to increase the quality of the product and to speed up the product release to the market.Assuming you have the Maven project is ready and executing well from command prompt using the below Maven command to run you tests,
mvn clean install
How to create a Jenkins job for a maven project
- Create a new job using "New Item"
- Enter the Name and Select Maven Project and scroll down
- If you have any other job from which you want to copy all the defined configuration you can specify here. Else Click on Ok
- Write some description about the Job, So when some one sees the job can easily understand
- Discard old builds option is to Keep the old builds up to certain no of days or you can select the no of old builds to keep. You can either give no of days or just no of builds to keep. Don't enter both
- To send some Parameters to your tests, you can select "This Project is Parameterized" option.
Example for creating a parameter - Source code Management. If your code is in GIT repo, Then you need to specify the repo url and credentials to access it.Specify the branch which needs to be considered for build
- If you want to trigger the build automatically then check the option "Build Periodically" from Build Triggers
- When a build is stuck for more than accepted time then you can abort it using this option
- You can do some Pre build actions, like moving some files or creating directories using this step
- Build Step is where you give the path to your pom.xml file and write the maven command ex: "mvn clean install" or ... in goals options
- If you want to add post build actions like triggering some email with report or run any other job, Post build option is used for that
- Finally save the Job
Hope you get some idea on how to create a Jenkins job. Happy learning. Thank you.
Comments
Post a Comment