Dear Readers,
In this article, we will see the Troubleshooting a Bug In Maven Project.
Steps to Follow
- Create a Maven Project.
- Create a bug.
- Build job “kt-mavenjob.
- Verify Console Output of job “kt-mavenjob.
- Troubleshoot Maven Project.
- Buid job “kt-mavenjob”.
- Verify console output of job “kt-mavenjob”.
1. Create a Maven Project
Create Maven Project by using below link.
We can see the job “kt-mavenjob” of the maven project.
![This image has an empty alt attribute; its file name is ktexperts-10.png](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-10.png)
I am intentionally creating bugs for testing then troubleshoot the bug.
2. Create a bug
Go to the repository “time-tracker” by using below link.
https://github.com/Ramesh-Ktexperts/time-tracker
We can see the repository “time-tracker”
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-1.png)
Click on Core.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-2.png)
Click on Src.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-3.png)
Click on main/java/training/tayler/timetracker/core.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-4.png)
Click on the file tracker.java.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-5.png)
Click on Edit button.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-6.png)
Comment 3rd and 4th lines intentionally to create the bug.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-7.png)
Click on commit changes.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-8.png)
The file tracker.java has been updated successfully.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-9.png)
3. Build job “kt-mavenjob”
Go to Jenkins main dashboard,there we can see the job “kt-mavenjob”
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-10.png)
give right click on the name of job “kt-mavenjob” and click on Build Now.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-11-5.png)
We can see the Red ball, which means the job got failed.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-12-1.png)
4. Verify Console Output of job “kt-mavenjob”
Click on job “kt-mavenjob”.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-13.png)
click on Red Ball.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-14.png)
In the console output,we can see the out put of job “kt-mavenjob”.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-15.png)
5. Troubleshoot Maven Project
Go to the repository “time-tracker” by using below link.
https://github.com/Ramesh-Ktexperts/time-tracker
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-1-6.png)
Click on Core.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-2-6.png)
Click on Src.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-3-5.png)
Click on main/java/training/tayler/timetracker/core.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-4-7.png)
Click on the file tracker.java.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-5-9.png)
Click on Edit button.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-6-5.png)
UnComment 3rd and 4th lines to resolve the bug.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-7-3.png)
Give commit message “Modified” and click on Commit changes.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-8-3.png)
The file tracker.java has been updated successfully.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-9-4.png)
6. Buid job “kt-mavenjob”
Go to Jenkins main dashboard there we can see the job “kt-mavenjob” got failed.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-10-4.png)
Go to job “kt-mavenjob” and click on Build Now.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-11-6.png)
We can see the green color that means the job has build build succusfully.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-12-5.png)
7. Verify console output of job “kt-mavenjob”
Click on job “kt-mavenjob”.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-13-4.png)
Click on green color (#3).
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-14-3.png)
In the console output,we can see the out put of job “kt-mavenjob”
![](https://www.ktexperts.com/wp-content/uploads/2020/02/ktexperts-15-3.png)
Thank you for giving your valuable time to read the above information.
Follow us on
Website : www.ktexperts.com
Facebook Page : KTexperts
Linkedin Page : KT EXPERTS
Follow Me
Ramesh’s Linkedin : https://www.linkedin.com/in/ramesh-atchala/