简体   繁体   English

Jenkins 显示空白 html 代替报告

[英]Jenkins show blank html instead of report

I use Jenkins 1.656 and HTML publisher plugin 1.11.我使用 Jenkins 1.656 和 HTML 发布者插件 1.11。

I have successfully added HTML report section in the job: Jenkins project configuration我已成功在作业中添加 HTML 报告部分: Jenkins 项目配置

Unfortunately when I click on HTML Reports, it shows only blank page .不幸的是,当我点击 HTML Reports 时,它只显示空白

The zip button works -- it downloads the report archive. zip 按钮有效——它下载报告存档。

I will appreciate any help我将不胜感激

The issue was with nginx server, it was 问题是nginx服务器,这是

add_header X-Frame-Options DENY;

changed to 变成

add_header X-Frame-Options SAMEORIGIN;

perhaps you have some JS in your report? 也许您的报告中有一些JS? Read this page: https://wiki.jenkins-ci.org/display/JENKINS/Configuring+Content+Security+Policy and try to relax the security rules by changing JAVA_OPTS in tomcat.conf, then restart tomcat and clear broveser cache 阅读此页面: https ://wiki.jenkins-ci.org/display/JENKINS/Configuring+Content+Security+Policy并尝试通过更改tomcat.conf中的JAVA_OPTS放宽安全规则,然后重新启动tomcat并清除浏览器缓存

I just saw your comment, try empty parameter: -Dhudson.model.DirectoryBrowserSupport.CSP= 我刚刚看到您的评论,请尝试使用空参数:-Dhudson.model.DirectoryBrowserSupport.CSP =

I faced the same issue but when I executed the command below in the script console it worked. 我遇到了同样的问题,但是当我在脚本控制台中执行以下命令时,它起作用了。 Please try: 请试试:

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

Try by adding 1 more Build step in configuration with below command:尝试使用以下命令在配置中添加 1 个构建步骤:

npm install newman-reporter-html -g npm 安装 newman-reporter-html -g

Find the ss for reference: https://prnt.sc/0Nv3xwYx3aWj找到ss供参考: https://prnt.sc/0Nv3xwYx3aWj

For me above didn't work. 对我来说,上面没有用。 I publish report from IBM RPT (multiple .js files and index.html). 我从IBM RPT发布报告(多个.js文件和index.html)。 Jenki: reads index.html, first 2 .js files, but then it cracks on the others (searching them on the wrong path. Jenki:先读取index.html的2个.js文件,但随后它会破解其他文件(在错误的路径上搜索它们)。

when downloaded in zip it works fine. 以zip下载时,效果很好。 thx 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM