【发布时间】:2023-03-24 18:14:01
【问题描述】:
我正在使用 Gradle (./gradlew -Pprod bootRepackage) 将我的 JHipster 应用程序部署到生产服务器 (Wildfly 10)。它大部分都在工作,但缺少一些内容。以下是两个示例(左侧为 prod,右侧为本地开发环境):
我没有在 Chrome 控制台或 Wildfly 服务器日志中看到任何错误记录。
这是第一页上没有显示的块:
<div class="row">
<div class="col-md-6">
<a href="http://ca.linkedin.com/in/yvoncomeau"><span class="linked-in-button img-responsive img-rounded"></span></a>
<br/><br/>
</div>
<div class="col-md-6">
<a href="https://roundwheeltech.wordpress.com/"><span class="wordpress-button img-responsive img-rounded"></span></a>
</div>
</div>
...这些图像类的 CSS,以及其他两个可以工作的图像(roundwheel-logo 和 roundwheel-cirle):
.roundwheel-logo {
display: inline-block;
width: 300px;
height: 91px;
background: url("../images/roundwheeltechnologies-2x.jpg") no-repeat center top;
background-size: contain;
}
.linked-in-button {
display: inline-block;
width: 160px;
height: 33px;
background: url("../images/linkedinprofilebutton.gif") no-repeat center top;
background-size: contain;
}
.wordpress-button {
display: inline-block;
width: 160px;
height: 33px;
background: url("../images/wordpress-logo-hoz-bg.png") no-repeat center top;
background-size: contain;
}
.roundwheel-cirle {
display: block;
width: 100px;
height: 113px;
background: url("../images/rw-circle.png") no-repeat center top;
background-size: contain;
margin-left: auto;
margin-right: auto;
}
...
以及这些图像的放置位置:
war 文件确实包含带有时间戳的图像:
...并且缩小的 CSS 引用了正确的时间戳版本。
【问题讨论】:
-
您应该首先确定是包装问题还是服务器问题。那么在使用带有 prod 配置文件的可执行 jar 时它是否有效?
-
使用 prod 可执行 jar 运行时的行为相同。
-
所以我可以,不相信 ter 在 Chrome 控制台中没有错误,您应该会看到一些 404 错误。
-
由于只有一些图像和 CSS 丢失,我想你没有把它们放在预期的位置,所以当 jhipster 构建过程缩小和版本它们时,HTML 代码不会被重写并且仍然指向原始路径不包括版本时间戳。
-
上面的第一页给出了这个错误:http://..[ip]../api/account?cacheBuster=1476448351226 401(未经授权),这看起来很正常(我不是登录)。第二页没有错误。
标签: material-design angular-material jhipster