Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins - HTML Publisher Plugin build fails with report directory doesnot exist

Tags:

jenkins

I am using the HTML publisher plugin and I am generating html report and placing in a report folder report/profile.html. I have specified the path where my report is in HTML directory to archive. I gave the path as /apps/cmjenkins/workspace/service_testapps_copy/LISA Project/Mezzo_Automation/Reports. That gave directory does not exist error so gave the complete path as well: C:/Users/dtiker/Documents/Feb24/universe1_0_testapps/service_testapps/LISA Project/Mezzo_Automation/Reports

Below is the error i see in console output after i run my jenkins build

12:45:34 [htmlpublisher] Archiving HTML reports...
12:45:34 [htmlpublisher] Archiving at PROJECT level C:/Users/dtiker/Documents/Feb24/universe1_0_testapps/service_testapps/LISA Project/Mezzo_Automation/Reports to /var/lib/jenkins/jobs/API_PROFILE_HTML_Report_POC/htmlreports/HTML_Report
12:45:34 ERROR: Specified HTML directory 'C:/Users/dtiker/Documents/Feb24/universe1_0_testapps/service_testapps/LISA Project/Mezzo_Automation/Reports' does not exist.
12:45:34 Build step 'Publish HTML reports' changed build result to FAILURE
12:45:34 Finished: FAILURE

I verified that that directory does exist. Can someone let me know what i am doing wrong?

like image 563
user2864458 Avatar asked Oct 24 '25 12:10

user2864458


1 Answers

Your job (each node{}) will use an own workspace, you should always reference files of the current build with a relative path!

publishHTML(reportDir: 'reports', reportFiles: 'profile.html'])
like image 195
Christopher Avatar answered Oct 27 '25 01:10

Christopher