0

I use html publisher plugin to generate html report in Jenkins Server and the report is generated successfully. However, it can display any image in the report when I view it in Jenkins Server like the picture:

e

When I right click that logo and choose open image in new tab, the image can be view in new tab properly. Also, if the report viewed in local file system, the image can be displayed.

Why the image in the report cannot be viewed in Jenkins Server? How can I fix it? or there are any solution?

slavoo
  • 5,798
  • 64
  • 37
  • 39
chan sum
  • 41
  • 1
  • 6

1 Answers1

1

I had the same problem, even tried base64 encoding the image and it still didn't work, didn't even display the alt text. This solved it: https://stackoverflow.com/a/35785788/3216461

TL;DR: Go to Manage Jenkins --> Script console and type in the following command:

System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "")

It's just a temporary solution though, you'll have to run the command again if you restart Jenkins.