'How can I generate html reports in jenkins
Image of post build action step for "Publish HTML Reports plugin" in maven based project
After adding the plugin also I am getting http 404 error.
Is there anything required to write any shell script or any code in pipeline to generate html reports or directly we can generate html reports?
Can you please help me out in resolving the error....??
Solution 1:[1]
According to documents on the plugin page, it only helps us bring the pages to Jenkins dashboard (not generate them). That means we have to generate the HTML files in our pipeline or build steps using other tools.
If you use maven, I suggest you look at Surefire. Run the test and generate HTML reports in build steps. Then, publish them with the plugin in post-build steps.
Solution 2:[2]
For Freestyle Project :-
For Pipeline Project :-
Add the below piece of code :
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: true, reportDir: "HTML Report Directory", reportFiles: 'html-file_name', reportName: 'HTML Report', reportTitles: ''])
Change the tag - reportDir and reportFiles accordingly
Solution 3:[3]
So in my project, first I create a report that create during running of my tests localy (use ExtentHtmlReporter library for that )
- in my Jenkins => configure
- going down until "Post-build Actions"
- press "add post-build action"
- press on "publish HTML report"
added image
in the added field you should fill like that
the path , the html file name (the image that added it my project where my report create)

Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Lam Le |
| Solution 2 | user_9090 |
| Solution 3 | Vladi |


