Noticed in latest jenkins build (e.g. 2.19.2), the css style of html report published by html-publisher-plugin is not working.
- This is due to Content Security Policy in Jenkins
- By default the policy is set:
The default rule is set to: sandbox; default-src 'none'; img-src 'self'; style-src 'self';
- which applies:
- No plugins (object/embed) allowed
- No inline CSS, or CSS from other sites allowed
- No images from other sites allowed No frames allowed
- No web fonts allowed No XHR/AJAX allowed etc.
- Go to “Manage Jenkins” -> “Script console”
- Type and run below command:
See this stackoverflow for reference: Jenkins - HTML Publisher Plugin - No CSS is displayed when report is viewed in Jenkins Server